Conversation
/reload-mcp diffed `_servers`, which holds only servers with a live session. Anything configured but not connected at that instant came out as "➖ Removed": a server still mid-connect, one gated `enabled: false`, one serving a post-failure backoff, or one lazily registered from the schema cache. The same wrong wording went into conversation history, telling the model a working server was gone. cli.py `_reload_mcp` and gateway/run.py `_execute_mcp_reload` carried identical copies of the diff, so both now call a shared `summarize_mcp_reload()`. Only a name absent from config.yaml counts as a removal. Anything else still in config renders as "⏳ Still configured, not connected: name (connecting/failed/disabled)". Availability now comes from a single `get_mcp_status()` snapshot instead of `_servers` membership, which is wrong in both directions: a parked server sits in `_servers` with `session=None` and would be announced as reconnected, while a lazily registered one has callable tools and no `_servers` entry and would be listed as not connected. Adds `gateway.reload_mcp.pending` to all 17 locale catalogs (test_i18n asserts parity) and a unit test for the diff. Fixes NousResearch#80771
12 tasks done
This branch has not been deployed
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.
What does this PR do?
/reload-mcpdiffed_servers, the live connection registry, which only holds servers with an established session. Anything configured but not connected at that moment printed as➖ Removed: still mid-connect,enabled: false, serving a post-failure backoff, or lazily registered from the schema cache.The same wording went into conversation history, which tells the model a working server is gone.
Now only a name absent from
config.yamlcounts as a removal. Anything else still in config shows its real state:cli.py:_reload_mcpandgateway/run.py:_execute_mcp_reloadheld identical copies of the diff, so both now calltools/mcp_tool.py:summarize_mcp_reload().Availability comes from one
get_mcp_status()snapshot rather than_serversmembership, which is wrong in both directions.A parked server sits in
_serverswithsession=None, so a membership check calls it reconnected while/mcpshows it failed.A lazily registered server has callable tools and no
_serversentry at all, so a healthylazy: trueconfig would report it as not connected on every reload.Related Issue
Fixes #80771
Type of Change
Changes Made
tools/mcp_tool.py:summarize_mcp_reload(old_servers)returnsconnected/added/reconnected/removed/pending.cli.py,gateway/run.py: both reload paths call it and print the new line in the output and in the history note.The helper blocks on
_lock, so the gateway calls it throughrun_in_executor.locales/*.yaml:gateway.reload_mcp.pendingin all 17 catalogs (tests/agent/test_i18n.pyasserts parity).tests/tools/test_mcp_reload_diff.py: still configured, dropped from config, newly added, lazy.How to Test
A deterministic version of the issue's timing-dependent repro:
hermeswith a working MCP server and confirm it with/mcp.enabled: falseon that server inconfig.yaml./reload-mcp.Before:
➖ Removed: <server>.After:
⏳ Still configured, not connected: <server> (disabled).Also worth checking: an unreachable
commandreports(failed), and deleting the server fromconfig.yamlstill reports➖ Removed.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings)cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs