fix(mcp): Notifications/tools/list_changed support not working#21050
Merged
fix(mcp): Notifications/tools/list_changed support not working#21050
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request improves the robustness of handling MCP list_changed notifications. The changes to always register notification handlers and to add a retry mechanism for tool discovery are good enhancements to deal with non-compliant or racy MCP servers. I've found a potential issue in the new refresh scheduling logic in mcp-client-manager.ts where a pending refresh request could be lost if the current refresh operation fails.
|
Size Change: +5.27 kB (+0.02%) Total Size: 25.9 MB
ℹ️ View Unchanged
|
249c132 to
6d537f0
Compare
bdmorgan
approved these changes
Mar 4, 2026
neeraj-par
pushed a commit
to neeraj-par/gemini-cli
that referenced
this pull request
Mar 4, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
BryanBradfo
pushed a commit
to BryanBradfo/gemini-cli
that referenced
this pull request
Mar 5, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
struckoff
pushed a commit
to struckoff/gemini-cli
that referenced
this pull request
Mar 6, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
kunal-10-cloud
pushed a commit
to kunal-10-cloud/gemini-cli
that referenced
this pull request
Mar 12, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
liamhelmer
pushed a commit
to badal-io/gemini-cli
that referenced
this pull request
Mar 12, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
yashodipmore
pushed a commit
to yashodipmore/geemi-cli
that referenced
this pull request
Mar 21, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
SUNDRAM07
pushed a commit
to SUNDRAM07/gemini-cli
that referenced
this pull request
Mar 30, 2026
…e-gemini#21050) Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change was done with TDD with tests that were verified to fail before implementing the code.
listChanged. This improves resilience against servers that might send notifications without fully adhering to capability declarations.mcp-clienthave been updated to reflect the new robustness logic, including a new test case to verify notification handler setup whenlistChangedis false, and improvements to how notification callbacks are identified in mocks.Fixes #19509