| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This is the right fix — sending an ErrorData response after notifications/cancelled violates JSON-RPC 2.0 which says you should send at most one response per request. Having both a notification and an error response for the same request ID is the kind of thing that makes conformant clients confused about whether to expect more data. Does this change affect any of the existing integration tests for the cancellation flow? |
Sorry, something went wrong.
|
Closing in favor of #2493, which also resolves the sender's local pending response (matching the TypeScript SDK), so the caller doesn't hang until timeout when the response is no longer sent. Thanks for the contribution. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
RequestResponder.cancel() in mcp/shared/session.py sent an ErrorData(code=0, message="Request cancelled") JSON-RPC response back to the sender after a notifications/cancelled was received. The MCP cancellation spec explicitly states:
This unexpected response caused strict clients (e.g. Claude Code) to treat it as an unknown message ID, close the transport, and reconnect — making every cancellation of a long-running tool cost a full reconnect cycle.
Changes
Fixes #2480