cmux mcp: terminals by tab or pane, waits on output, named missing fields, 'runs in cmux' (tool-evals round 3)

Merged
LA
7d ago
+408-31

Summary

This is round 3 of the cmux MCP tool-eval hill climb. Round 2 (#28085) is merged, and this branch now contains feat-cmux-next (781b021). Every change below comes from an error seen in the eval panels, in tests/tool-evals.

cmux MCP (cmux-tui/crates/cmux-tui/src/cli/mcp*)

  • A terminal named by its tab or pane. terminal: "<tab name>", terminal: "tab_…" and terminal: "pane_…" now act on that tab's terminal, or on the terminal of the pane's shown tab.
    • A plain name resolves through tab_list, in the call's session or the <session>: the name carries. It is used only when exactly one tab has that name.
    • A name given with a pane, screen or workspace resolves through tab_get.
  • Waits match output, not the typed command. When a terminal_wait pattern also matches the command this server just typed in that terminal, the server waits for the pattern at the start of an output line. The result carries a note about the change. Before, cmd; echo DONE followed by a wait for DONE matched the typed line at once.
  • workspace_create holds a terminal by default. With no initial_content, the new workspace holds a terminal, as cmux workspace create does. The field was required over MCP.
  • Missing fields are named. When a required field is missing, the error now names every missing field and its values. It used to say only "required parameter is missing".
  • The instructions say the chat runs in cmux. The instructions and the cmux_exec description now say: a terminal, tab or workspace that the person asks for is a cmux one, made with these tools and not in the agent's own shell. GPT 6 Astra ran commands in its own shell.
  • Tool sheet text:
    • terminal_wait matches the output line.
    • Split the pane for two terminals "side by side".
    • pane: "current" is the chat's own pane, not the right column.

cmux CLI (cli.rs): an old command, such as rename-workspace, workspace-action, list-workspaces, new-surface, new-pane or send, now prints the resource command to use.

cmux-tui-core (browser_providers.rs): the "no browser engine" error now tells the agent to stop and to ask the person to open the session in the cmux app. The old text said "launch cmux-browser", and agents then looked for other sessions' sockets.

Size: 8 files, about +400/−30 lines, including tests.

Changelog

Changed: cmux MCP finds a terminal by its tab or pane, waits for a command's output and not its echo, names missing fields, and tells agents that terminals and workspaces are made in cmux. Old cmux CLI commands now name their new form.

Testing

These tests run on the rbx builder at each commit. The results here are at 641e9d7, the merged branch:

  • cargo test -p cmux-tui --lib -- cli::mcp cli::beside: 151 passed.
  • cargo test -p cmux-tui --lib -- upstream: 18 passed. This includes the 2048-character instructions check.
  • cargo test -p cmux-tui --test cli -- caller_selector: 4 passed.
  • cargo test -p cmux-tui --test cmux_surface -- classic: 2 passed. This includes a_classic_verb_names_its_resource_command, which runs the real binary.
  • cargo test -p cmux-tui-core --lib browser_engine: 4 passed.
  • clippy with -D warnings: 0 warnings.

Eval panel on 3756b59 (34 headless cases, 2 samples each, all agents under the live guard, daemons on rbx):

Modelm1 (#28085)r3m
Opus 5.53434 (68/68)
Sonnet 5.53434 (68/68)
Haiku 5.53434 (68/68)
DeepSeek v4.1-flash3334
Gemini 4 Argon3334
Grok 4.73134
Kimi K3.1 Pro3334
Qwen 3.8 Max3133
MiniMax M3.1 Flash3332
Mistral Large 43232
GLM 5.3 FlashX2832
GLM 5.3 Prime3031

Claude passes 204/204 samples, and the OpenRouter models pass 602/612.

Observed / Not run

  • Observed: all of the above. Each new test fails without its change; the reviews confirmed this.
  • Not run yet: the full panel on the merged branch is running. GPT 6 Astra through codex app-server is running on 54ad3fc. Results will be posted as a comment.
  • Not run: the app tier (browser, Markdown) and --surface all / cli.

Reviews

Every commit had a correctness review by a subagent. Findings and fixes:

  • Tab-name lookup:
    • tab_get cannot find an unscoped name. Fixed with tab_list.
    • The s2: prefix was ignored (9881e08).
    • A test could not fail without the fix (06739d3).
    • A name given with a pane listed the whole session (855196f).
  • 855196f..091d22e: cmux tab create was suggested, which is not valid. Now tab create terminal (33171b8).
  • 7bf826c: two doc comments were on the wrong items (0e22b3b). Known trade-off: a wait for text in the middle of an output line can now time out. The wait is bounded, and the result notes the change.
  • 3756b59..641e9d7: no blocking findings.
    • Name all missing fields in one error, and add the "runs in cmux" rule to the instructions without code mode (d6c269c).
    • Not changed: a newer daemon that makes a field optional is still refused by an older server.
  • Merge (781b021): nothing was lost from the base. The only base change in these files was mod upstream_listing; from #27976.