Skip to content

[Server] Include the request id in the error for an initialize request with a session ID - #758

Open
andre-schade wants to merge 1 commit into
modelcontextprotocol:mainfrom
andre-schade:fix/initialize-error-request-id
Open

andre-schade wants to merge 1 commit into
modelcontextprotocol:mainfrom
andre-schade:fix/initialize-error-request-id

Conversation

@andre-schade

Copy link
Copy Markdown

Fixes #755

Protocol::resolveSession() answered an initialize request that comes with a session ID (e.g. a repeated initialize on STDIO) with an error without id. The spec requires error responses to carry the id of the request ("Error responses MUST include the same ID as the request they correspond to"), so the client could not correlate the error and waited for a timeout.

This passes self::findRequestId($message), like the other branches of the method already do. The existing test now also asserts the id.

🤖 Generated with Claude Code

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Error response to a repeated initialize has no id

2 participants