fix(tui): discover profile MCP before desktop agent snapshot - #51865
Closed
stavytskyi wants to merge 1 commit into
Closed
fix(tui): discover profile MCP before desktop agent snapshot#51865stavytskyi wants to merge 1 commit into
stavytskyi wants to merge 1 commit into
Conversation
13 tasks
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
tui_gateway.server._make_agentbefore constructingAIAgent.mcp_serverssection.Why
Desktop/dashboard sessions can be created for a profile that differs from the dashboard process' launch
HERMES_HOME. The dashboard startup MCP discovery only covers that launch profile. When the user opens a chat under another profile,AIAgentsnapshots its tools during construction; if that profile's MCP servers were not discovered first, the model never receives the MCP tool schemas for that session even though the profile hasmcp_serversand matching toolsets configured.Prior art / duplicate check
This is intentionally a follow-up to the already-merged Desktop MCP discovery fix in #44512, not a duplicate of it.
/api/wsbackend, fixing the case where Desktop never started MCP discovery at all._make_agent()must discover MCP tools while that selected profile is bound, beforeAIAgentsnapshots its tools.I also checked the related open PRs (#42703, #43189, #38301, #50615, #51322). They cover dashboard startup, websocket/API/CLI startup timing, or cold-start waits; none specifically guarantees per-selected-profile MCP discovery immediately before Desktop/TUI agent snapshot.
Test plan
REPO=<path-to-hermes-agent>; cd "$REPO" && PYTHONPATH="$REPO" "$REPO/venv/bin/python" -m pytest tests/tui_gateway/test_make_agent_provider.py -q -o 'addopts='Result:
13 passed, 1 warning in 1.73s.