Configure agents, presets, transport
Detect installed agent CLIs, pick launch presets, and choose how each one authenticates and talks to orch.
Goal#
Tell orch which coding-agent CLIs are on your machine, how to launch each one (headless dispatch vs. native TUI), which credentials it should use, and — for the few that support it — how to drive it over the Agent Client Protocol (ACP) instead of scraping a subprocess pipe.
Steps#
-
Scan your PATH for known agent CLIs (Claude, OpenCode, Cursor, Codex, Copilot, …):
orch agents scanWrites a snapshot; does not touch
orch.yamlyet. -
Review what was found:
orch agents show -
Apply new detections to
orch.yaml(never overwrites presets you already edited):orch agents apply -
Presets live in two maps in
orch.yaml:agents.cmds.<preset>— headless BYO template used by dispatched workers, e.g.claude -p "{{prompt}}". Built-ins ship forcopilot,claude,opencode,grok,kimi,commandcode,agy,codexandcursor.agents.interactive.<preset>— native TUI launch used byorch <preset>(no prompt required), e.g.codex,cursor-agent,claude,opencode --hostname 127.0.0.1 --port {{notify_port}}.
Edit either map directly in
orch.yamlto add a CLI orch doesn't know about, or to change an existing template. Dispatching a recognized CLI preset that has noagents.cmds.<preset>entry fails loudly to the Chair (preset "<preset>" has no headless command: set agents.cmds.<preset>) instead of silently running the stub agent — add the entry to fix it. -
Choose the credential mode per preset with
agents.auth.<preset>:account— the agent keeps its own plan login; orch injects only its ownORCH_GATEWAY_*vars, never provider keys.gateway— the agent authenticates with orch's virtual key and all model traffic routes through the local gateway.
Defaults:
codexandcursorareaccount(forcing credentials on them drops the subscription's connectors).claudeisgatewayonly when an Anthropic passthrough key is configured, otherwiseaccount. Everything else defaults togateway. -
For CLIs that expose an Agent Client Protocol server mode — currently
gemini(gemini --acp) andopencode(opencode acp) — set:agents: transport: gemini: acpACP makes tool calls and permission prompts visible to orch instead of scraping stdout. Any other preset stays on the default
subprocesstransport;agents.acp.<preset>holds the invocation orch runs to put the CLI into ACP mode (built-in for gemini/opencode, empty for everything else — a preset with no ACP entry cannot usetransport: acp). -
Set run limits:
agents: timeout_sec: 600 # hard wall-clock cap per run (0 = default) idle_timeout_sec: 0 # kill if no stdout/stderr for this long; 0 = off
Verify#
orch <preset>
launches the native TUI for that preset. For a headless dispatch, check
.orch-agent.log in the session's worktree for the resolved command and any
permission/timeout exit codes (124 = agents.timeout_sec/idle timeout,
126 = a headless permission prompt orch couldn't answer).
Undo#
Remove the preset's entry from agents.cmds / agents.interactive, or reset
agents.auth.<preset> / agents.transport.<preset> to unset to fall back to
the defaults above.
Related#
gateway-keys-and-connect.md— whatagents.auth: gatewayactually routes through.troubleshooting.md— worker permission timeouts.