fix(tui): show per-server MCP connection status in TUI#2280
Merged
Conversation
- Add `ServerConnectOutcome` struct to `zeph-mcp` with id, connected flag, tool_count, and error string; `connect_all()` now returns `(Vec<McpTool>, Vec<ServerConnectOutcome>)` covering all failure paths including OAuth errors and skipped servers - Add `McpServerConnectionStatus` enum and `McpServerStatus` struct to `zeph-core::metrics`; `MetricsSnapshot` gains `mcp_connected_count` and `mcp_servers`; `mcp_server_count` now reflects total configured servers - Propagate outcomes through `McpState.server_outcomes`, `with_mcp_server_outcomes()` builder method, and `with_metrics()` in agent builder - Keep `mcp_connected_count` and `mcp_servers` consistent on `/mcp add` and `/mcp remove` commands - Resources panel: change MCP line to "N/M connected, K tools" format - Skills panel: add per-server status rows (OK green / FAIL red) with tool count above the tool list - Fix pre-existing `clippy::unused_async` on `scrub_pii_union` (blocked -D warnings)
1e53638 to
9f08720
Compare
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.
Problem
The TUI's MCP Tools panel always showed the total tool count from successfully-connected servers only. When a server failed to connect, it silently disappeared — the Resources panel showed "2 servers, 14 tools" even if one of three configured servers failed. There was no per-server status visible anywhere.
Changes
zeph-mcpServerConnectOutcome { id, connected, tool_count, error }structconnect_all()return type to(Vec<McpTool>, Vec<ServerConnectOutcome>)— all failure paths covered (connection error, list_tools error, OAuth errors, skipped servers)configured_server_count()methodagent_setup.rs,daemon.rs,acp.rs)zeph-core::metricsMcpServerConnectionStatusenum (Connected/Failed)McpServerStatus { id, status, tool_count, error }structmcp_connected_count: usizeandmcp_servers: Vec<McpServerStatus>toMetricsSnapshotmcp_server_countnow = total configured servers (not just connected)zeph-coreagentMcpStategainsserver_outcomes: Vec<ServerConnectOutcome>with_mcp_server_outcomes()builder methodwith_metrics()derives counts from outcomes/mcp addand/mcp removekeepmcp_connected_countandmcp_serversin synczeph-tui"N/M connected, K tools"formatOther
#[allow(clippy::unused_async)]onscrub_pii_union(pre-existing clippy failure that blocked-D warningsunder default features)Test plan
cargo nextest run --workspace --lib --bins)cargo clippy --workspace -- -D warningscleancargo +nightly fmt --checkcleanresources_with_full_infraupdated to show2/2 connected, 14 toolsCloses #2277