cmux NEXT Inspector Connectors: a failed MCP server has Reconnect

Merged
TE
11d ago
+672-22

Adopted and rebased (2026-10-25). #24223 landed (f08f46b), so this branch now carries only its own change: the original two commits, patch-identical by range-diff, plus one review fix.

Review fix. A Codex re-review found a bug in reconnectMcp. During a chat switch's hold, the pane still draws the old chat, but reconnectMcp sent the request to selectedSessionId, which already names the chat opening. A Reconnect click on the drawn chat's server therefore went to the hidden chat. reconnectMcp now uses actingSessionId, as Stop, answers and Use tools already do. The fix went in test-first:

  • d77ca88 adds a test to agent-pane-hold-acting-chat.test.ts. On the fleet it failed (received hold-acting-b).
  • 938830c makes the change. On the fleet the hold, connectors and session-start tests pass (12 of 12), and bun run typecheck is clean.

Review. A fresh Codex (gpt-6-astra, xhigh) BLOCKed at 171c452 on that one finding. It then said SHIP at 938830c and confirmed that the earlier review's four fixes still hold.

No new timer or observer.

Leo, on the Inspector: "every item must do something on click; Environment, Context and Connectors: their chevrons open their detail." The dead-click audit (#24116) found that Connectors' "Needs reconnect" and "N to reconnect" looked like actions but were plain text.

What changes

  • Reconnect where it works. acpmux lists _acpmux/mcp/reconnect in initialize where it serves it (snapshot.reconnectsMcp). There, a failed MCP server's row in Connectors has a Reconnect button. It sends reconnectMcp(server) for that server and reads "Reconnecting…" while Claude Code connects it. After an error it reads "Try again" in the danger colour and tries again. Once acpmux marks the server connected, the row says Connected.
  • Plain text everywhere else. On an older acpmux or another harness's chat, "Needs reconnect" stays plain text, so nothing looks clickable that is not.
  • The head line. "N to reconnect" is in the section's disclosure head, which opens the list where the buttons are.
  • Code. The server list moves out of ChatInspector.tsx into inspector/ConnectorsSection.tsx. Three strings are new: chatInspector.connectors.reconnectAction, .reconnecting and .retry, in all 21 locales.

Tests

  • webviews/test/chat-inspector-connectors.test.tsx covers:
    • The button asks for the failed server only.
    • It is disabled while waiting.
    • It reads Try again after a rejection and asks again on a second click.
    • Without onReconnectMcp, the failed state is a <span>, not a button.
  • Gallery: context-connectors-open now shows the failed server with Reconnect.

Observed / Not run

  • Ran scripts/web-lint.sh (passed) and python3 scripts/cmux-next/prepush-gate.py (no new violations).
  • Not run locally: bun tests and tsc (hooks block them on this Mac). PR CI runs them.

Changelog

  • Added: the agent pane Inspector's Connectors offers Reconnect on a failed MCP server of a Claude Code chat.

Agent session: big-red
🤖 Generated with Claude Code