fix(cli): wire existing terminal-agent list and send commands
What changes
cmux terminal list --agents and cmux terminal <id> send --text ... are implemented in cli/terminal_talk.rs, but the main cmux dispatcher never calls that module's run handler. The existing MCP tools agents_terminal_list and agents_terminal_send reach it directly. An agent following the advertised CLI examples therefore falls into the generic resource parser instead.
This PR routes just those two terminal-agent verbs to their existing owner before generic command parsing, including the term alias. All other terminal commands and --help keep their previous routing. It adds a subprocess regression that checks the shipped binary reaches the specialist send and list --agents argument validators and that terminal help still succeeds.
First change is a test-only commit, then the two-file routing fix. No new execution engine or API.
Changelog
- Fixed:
cmux terminal list --agentsandcmux terminal <id> sendreach the existing agent-terminal handlers.
Observed / Not run
Observed (source/diff inspection): feat-cmux-next at 07088897284b6637a4ddb5763e06ca1601d4aae2, current source and exact GitHub compare of b7a5371a819a0d7fa89191296ee2efa022dc41ff vs base. The diff contains one dispatcher line, one narrow router and one regression test (three files, +40/-0). Other terminal verbs retain the normal parser. Issue background: SW-10, CLI parity #23026.
Not run: Rust builds, cargo test, live terminal-agent send, hosted verification and platform CI. This chat's environment has read/write GitHub access but no Rust compiler, cmux checkout, or hosted runner. The test-first commit was authored before the fix; its expected red result is inferred, not observed. Keep this PR draft pending a focused hosted test on the exact head and review.
Suggested focused verification: ./scripts/verify-cmux-tui-hosted.sh --filter terminal_agent_list_and_send_reach_their_cli_handlers on an approved cmux Testbox; then cargo test -p cmux-tui terminal_talk on the hosted runner. Review the fix on the pushed SHA.
Out of scope: durable whole-send retry IDs, separately documented at #23026.
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes cmux terminal list --agents and cmux terminal <id> send falling into the generic resource parser instead of reaching the existing terminal-agent CLI handlers.
- Routes just those two terminal-agent verbs (plus the
termalias) toterminal_talk's parser before generic command parsing; all other terminal commands and--helpkeep their previous routing. - Adds a subprocess regression test that verifies the shipped binary reaches the specialist argument validators for
sendandlist --agentsand that terminal help still succeeds.