Skip to content

mcp: cancelled and timed-out tool calls keep running on the server #191

Done

Description

@cabljac

When an MCP tool call times out (request_timeout_millis) or its caller is cancelled, the caller gets the error, but the server is never told. The server keeps running the tool until it finishes. With request_timeout_millis=None, an abandoned call also keeps running on the client until the connection closes.

client = define_mcp_client(ai, 'files', command='files-server', request_timeout_millis=5000)
# a tool call that runs past 5s
# today: the caller gets DEADLINE_EXCEEDED, the server keeps running the tool
# expected: same error, and the server gets notifications/cancelled for that request

Expected: send notifications/cancelled with the request id, so the server stops. Other calls on the same connection keep running. No notice during close, the handshake, or the liveness probe.

Fix: #120. Follow-up from genkit-ai/genkit#6194.

Activity

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions