Skip to content

fix(http): cancel local session requests on disconnect - #1328

Draft
kkkhs wants to merge 1 commit into
modelcontextprotocol:mainfrom
kkkhs:agent/local-session-disconnect-cancel-1325
Draft

kkkhs wants to merge 1 commit into
modelcontextprotocol:mainfrom
kkkhs:agent/local-session-disconnect-cancel-1325

Conversation

@kkkhs

@kkkhs kkkhs commented Oct 7, 2026

Copy link
Copy Markdown

Fixes #1325.

What

LocalSessionManager now treats dropping a request-wise response stream as cancellation for the in-flight client request.

Fix

Wrap request-wise response streams with a drop guard that asks the session worker to send a notifications/cancelled message and clean up the channel resources when the client disconnects before the stream completes.

Test

Added stateful_sse_client_disconnect_cancels_request alongside the existing stateless disconnect cancellation coverage.

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-transport Transport layer changes labels Oct 7, 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

T-core Core library changes T-test Testing related changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LocalSessionManager session workers don't cancel in-flight tool calls on client disconnect (follow-up to #857)

1 participant