You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce3a57a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(client): cancel an abandoned tools/call, prompts/get or resources/read (#1344)
* feat(client): cancel an abandoned tools/call, prompts/get or resources/read
A caller that drops `call_tool` (a `tokio::time::timeout`, a lost `select!`
branch) abandoned the request locally while the server kept working on it.
Send a best-effort `notifications/cancelled` for the request in flight when
that happens.
A drop guard, modelled on `PendingSubscriptionRequest`, is armed while the
response is awaited and disarmed as soon as it arrives, so dropping the
future while the client handler fulfils MRTR input requests cancels nothing.
Closes#1338
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(client): cancel any abandoned client request, per review
Every request the client peer sends now goes through the drop guard, not
only tools/call, prompts/get and resources/read. `initialize` is not
sent through `Peer`, and the helper is client-only: a client must never
cancel `initialize`, and from 2026-07-28 a server may send
`notifications/cancelled` only to end a subscriptions/listen stream.
The guard no longer unregisters a subscription that these requests never
register, and the test helper fails when the call never reaches the
point it is to be abandoned at instead of dropping the call anyway.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(client): keep server/discover off cancel-on-drop; borrow the peer in the guard
Per review: server/discover is part of the handshake like initialize, so
it goes back to plain send_request. AbandonedRequestGuard borrows the
peer instead of cloning it, and the helper's doc keeps only the
constraint a future editor must not break.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments