debug.agent_pane: compose_send and run_mode start a new chat on Cloud through the composer

Merged
TE
4d ago
+149-5

Leo, 2026-10-31: "whenever i start a chat it should be able to send me to cloud autommatically keep launching/downloading new dev builds and such". Done means running that flow in a DEV build and reading the reply, so a capture has to start a new chat on Cloud the way a person does.

Why

The capture verbs could pick a folder (pick_folder) and send (send_prompt), but send_prompt goes straight to chat.send. A new chat with Cloud picked only reaches cloud.startChat through the composer's own send (App.tsx onSend -> sendToCloud), so no scripted run could start a Cloud chat from the composer.

Change (DEBUG automation only)

  • debug.agent_pane compose_send {text}: puts the text in the composer and sends it as Return does (ComposerHandle.restore + send). Whatever the composer shows decides where it goes: this Mac, Sandboxed, or Cloud. It answers {sent, runMode, cloudStart}; a Cloud start answers sent: false while the composer holds the prompt until the chat opens on the machine.
  • debug.agent_pane run_mode {mode?}: reads the new chat's run place, or picks persistent, sandboxed or cloud as the run row's click does (sandboxModeRows.onMode). It refuses when the composer offers no run place.
  • Both are user verbs (DebugAgentPane.userVerbs), so they get the same gesture record as send_prompt and pick_folder.

Nothing changes outside DEBUG automation: the verbs exist only on window.cmuxAcpmuxDebug, which only DEBUG and bench builds call.

Tests

  • webviews/test/agent-pane-automation-compose-send.test.ts: a send goes through the composer and reports Cloud and the start; an unknown mode, a composer with no run place, no composer and an empty prompt are refused.
  • bun test on that file and on agent-pane-automation-waits-for-chat.test.ts, plus bun run typecheck, on the fleet: 8 pass, no type errors.

Used by the Cloud start capture state (cmuxterm-hq, cloudFixture.project) that proves the flow end to end.
Agent session: agent session

šŸ¤– Generated with Claude Code