pmux_agent_wait_ready
Poll a tab until an LLM agent is ready, detecting states like starting, busy, failed, or exited. Supports boot verification with completion evidence for reliable orchestration.
Instructions
Primary agent orchestration tool: poll a tab until an agent is ready, still starting/busy, launch_failed, exited, or timeout. Use pmux_send_input/pmux_capture_pane only as low-level fallbacks. agent_busy is non-terminal and keeps polling. Boot verification (recommended after pmux_agent_start): pass {bootId, expectEcho:true} — agent_ready is then returned ONLY on the bootstrap DONE marker (completion evidence; supersedes ready heuristics, requireBusyTransition and runtimeError), and every response carries boot.fileSeen (SessionStart boot-signal file — diagnostic only; on echo timeout, fileSeen:false suggests launch/hook-trust failure while fileSeen:true suggests the model never answered). Default timeout rises to 90s under expectEcho. requireBusyTransition defaults false for boot readiness; set true when waiting after send so ready is returned only after busy was observed or an initial non-ready baseline later changes to ready. In boot mode only (and never under expectEcho), pane fallback input_queued can be treated as a composer placeholder and returned ready; send validation remains strict. Uses pane capture + tab_status only; no server-side registry is kept. Session lifetime contract: keep the tab open until the task is finished, then close it with pmux_close_tab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes | Target tab id (from pmux_list_tabs / pmux_create_tab). | |
| bootId | No | bootId returned by pmux_agent_start. When set, every response includes boot.fileSeen (SessionStart boot-signal file existence — diagnostic only, never gates readiness). | |
| pollMs | No | Polling interval in ms. Defaults to 1500; minimum 500. | |
| provider | Yes | ||
| timeoutMs | No | Total polling timeout in ms. Defaults to 30000 (90000 when expectEcho is true); max 180000. | |
| expectEcho | No | Requires bootId, and is only meaningful when the agent was STARTED with bootstrapEcho:true (the default) — with bootstrapEcho:false no echo will ever arrive and this would time out. When true, agent_ready is returned ONLY once the bootstrap-echo DONE marker (req=bootId) is on the pane — evidence-based boot readiness that supersedes ready-pattern heuristics and requireBusyTransition. | |
| busyPattern | No | busyPattern regex override. Max 200 chars; compile errors become ToolError. | |
| workspaceId | Yes | Target workspace id (from pmux_list_workspaces). | |
| errorPattern | No | errorPattern regex override. Max 200 chars; compile errors become ToolError. | |
| readyPattern | No | readyPattern regex override. Max 200 chars; compile errors become ToolError. | |
| runtimeErrorPattern | No | runtimeErrorPattern regex override. Max 200 chars; compile errors become ToolError. | |
| requireBusyTransition | No | Defaults false for boot readiness. Set true when waiting after send; ready is returned only after a busy state has been observed. Superseded by expectEcho (the DONE marker is itself completion evidence). |