Skip to content

fix(client): ignore late discovery replies after legacy fallback - #1436

Draft
charliermarsh wants to merge 1 commit into
modelcontextprotocol:mainfrom
charliermarsh:charlie/ignore-expired-discovery-reply
Draft

charliermarsh wants to merge 1 commit into
modelcontextprotocol:mainfrom
charliermarsh:charlie/ignore-expired-discovery-reply

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

A legacy stdio server that takes 12 seconds to start can connect if it ignores server/discover, yet fail if it replies Method not found. After 10 seconds, the client has already sent initialize with ID 1. When the discovery error arrives with ID 0, the client gives up before reading the valid reply for ID 1.

We now remember the ID of the last discovery attempt. After a timeout, the client skips late successes and errors for that ID while it waits for initialize.

Closes #1400.

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-service Service layer changes labels Nov 6, 2026
@github-actions
github-actions Bot requested a review from jamadeo November 6, 2026 19:17
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@jamadeo is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

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-service Service layer changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto discovery timeout rejects a late probe response during legacy initialization

1 participant