Repository navigation
A launch can name chat or terminal: agent.launch gets a surface pick and the CLI gets --surface chat|terminal - #31191
Conversation
…ets --surface chat|terminal agent.launch gains an optional `surface` field, read by hosts advertising agent.launch.surface.v1. `terminal` always runs the agent's CLI; `chat` runs a chat even when the user's default is a terminal, and one the host can prove it cannot open is refused with a typed no-effects error before anything is created, so a retry answers with the same refusal. The pick is part of the replay fingerprint. `orca agent launch` and `orca worktree create --agent` accept --surface chat|terminal and refuse it on a host that would drop it, including the legacy worktree.create fallback.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
|
Agent launches previously followed the saved Chat UI setting, so a CLI caller could not choose chat or terminal for one launch. This PR adds The full review completed two rounds, an architecture challenge, a three-model design ruling and the readiness checklist. Fixes removed false chat refusals caused by an unresolved new-workspace root, made conclusive existing-host refusals fail before effects, rejected empty surface values, corrected the guide's fallback promise, added real CLI process/transport coverage and removed lockfile churn. No unresolved findings caused by this PR remain. An explicit chat that is conclusively impossible before effects fails and replays the same refusal. Unknown support can retain terminal fallback. If chat becomes unavailable after workspace creation, the workspace, setup and default tabs remain and a terminal opens. The CLI rejects an explicit pick before mutation when an older host lacks the capability; callers without a pick retain their existing path. Workers remain setting-driven. Intended inherited behavior: terminal creation replaces the first configured tab's command with the agent; chat creation runs all configured default tabs before chat. A late fallback retains that provisioned layout. Changing this belongs to #29095. Also deferred outside this PR: an existing recovered launch can retain a stale startup warning even when its agent starts successfully. Verification: automated CLI QA ( For the lane owner’s review |
ELI5
Starting an agent from the CLI always followed your Chat UI setting. You can now choose chat or terminal for one launch:
orca agent launch --agent claude --surface terminal, ororca worktree create --agent claude --surface chat. Omitting the option keeps the current behavior.What Changed
The shared
agent.launchrequest carries an optionalsurface: 'chat' | 'terminal'. The execution host honors it ahead of the relayed default and its own setting. The choice is part of the operation's retry identity, so replay cannot silently change which surface launches.agent.launch.surface.v1; otherwise the CLI says to update the execution host or omit the option. The check also covers the older workspace-create path.The host derives directory eligibility from root, custom and unresolved facts. Final refusal versus fallback also depends on whether this operation has already created its workspace. This prevents missing placement facts from becoming a false refusal, and prevents an existing workspace's definite refusal from silently launching the wrong surface.
Why
One optional field on the existing launch request lets each caller express the same per-launch choice without changing a saved setting or introducing another launch operation. That follows the common pattern. A separate field preserves the distinction between the user's default preference and an explicit choice that belongs in retry identity.
Linked Issue
Internal maintainer request. Companion desktop picker tracked in #31189; this CLI/host change is useful independently.
Visual Proof
N/A: no desktop screen changes. Actual CLI subprocess and transport coverage verifies the changed command behavior.
Testing
Full review path: shared request, cross-version capability checks, retry identity and launch selection.
Real CLI subprocesses execute the source CLI entry point with the pinned Bun runtime over a real Unix socket or Windows named-pipe transport. Automated host replies verify both commands, chat/terminal propagation, invalid input with no requests, and both older-host capability cases with no mutation. There is no artifact-dependent skip.
Host/executor tests cover root and subfolder create requests for worktree and folder workspaces, opposite defaults, late fallback retaining cwd, existing-workspace refusals and replay, and failure accounting after materialization.
Fingerprint and worker-launch tests cover omitted-surface compatibility and setting-driven workers.
The readiness check ran seven named suites (152 tests); affected CLI-process and executor suites passed again (64 tests) after the CI test typing repair. CI supplies lint, typechecking and platform checks. This is automated CLI QA (
qa=tests); no rendered app or real-agent run is claimed.I manually tested these changes locally
Automated tests added/updated
Review
Full review loop: two rounds, independent architecture challenge, a three-model design ruling and readiness checklist. The final status comment records fixes, verification and limits.
Agent skill upstream boundary
Notes
worker-startkeeps following settings; it has no new surface option.Checklist