Skip to content

[Client] Throw TimeoutException on request timeout and cancel the request - #567

Open
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-client-request-timeout
Open

chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-client-request-timeout

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

The default request timeout used `time()`, so it fired up to a second early, and it surfaced as a generic `RequestException` (-32603) without telling the server.

  • the default timeout now runs as a deadline like `callTool(timeoutSeconds:)` => sub-second, `TimeoutException` and `notifications/cancelled`
  • `TimeoutException` extends `RequestException`, so existing catchers keep working
  • the init timeout stays error-based (probe fallback depends on it), but with `microtime()` resolution

Fixes chr-hertel#68
Fixes chr-hertel#69

🤖 Generated with Claude Code

…uest

The default request timeout now runs as a sub-second deadline like the per-call one.
@chr-hertel chr-hertel added this to the 0.9.0 milestone Oct 10, 2026
@chr-hertel chr-hertel added bug Something isn't working Client Issues & PRs related to the Client component labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Client Issues & PRs related to the Client component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Client] Request timeout isn't a TimeoutException and sends no cancellation [Client] Request timeout only has 1-second resolution

1 participant