Repository navigation
fix(orchestration): launch remote workers as host-owned agent sessions - #28975
brennanb2025 wants to merge 15 commits into
Conversation
|
Starting a worker on another Orca server ignored the coordinator's chat preference and opened a terminal. Launch and cleanup assumed a terminal worker, which also caused an extra shell during setup and could hide a chat when failed-start cleanup could not close it. This PR lets a capable server own a chat worker while older peers keep terminal execution. Two review findings are fixed at
A fresh second review verified both repairs and main integration with no new findings. Later test-only corrections brought existing partial session-host fixtures up to the shared close contract, including released ownership and observed exit; original assertions and production behavior are unchanged. The final seven-area readiness audit found no new proven issue and ran from Deferred: a pre-existing error after worktree creation can omit that worktree from the error report (#20805); remote chats do not look up the coordinator's task title directly and can generate a title instead; and a compatibility concern involving partial advertised support has no identified affected released version. Stopped-host wake demand remains temporary under #28972. Intended existing-chat behavior: all configured terminal commands run alongside chat, while a terminal agent occupies the first configured terminal and skips its command. PR Checks 38811447122 completed successfully for Not ready to merge: the required aggregate-success condition is unmet because the aggregate was skipped; exact-head Windows/WSL Electron comparison, fault-path checks and screenshots also remain with the coordinator. Earlier Windows results apply to an older head. SSH regression was not run because the available host rejected the key. The final snapshot is mergeable with merge state CLEAN and no unresolved review threads. The PR remains in draft; no final runtime pass is claimed. |
|
Windows QA for head e3239a9 (Windows high spec, real signed-in Claude Code 2.1.302 inside a throwaway WSL2 distro, Codex driving the UI over CDP)
Setup failed on the WSL host (only the setup terminal, no chat): Older-host worker running as a terminal agent and finishing: |


ELI5
Starting a worker on another Orca server always opened a terminal, even when the user preferred native chat and that server could run it. Federation assumed every worker was a terminal; simply removing that assumption still left headless servers choosing from their own hidden chat setting. Workers now follow the dispatching coordinator's chat preference, while the server running the worker checks whether it can create the chat there.
What Changed
Capable servers use the existing agent launch executor and saved agent-session identity for existing folder workspaces, existing worktrees, and new top-level worktrees. Initial task delivery, mail, questions, status, output, stop, release, and recovery follow that identity. A lost reply after an accepted launch is reconciled through its saved dispatch rather than creating another worker.
The coordinator carries its preference in the existing optional
nativeChatDefaultlaunch field, using the existing client launch-mode capability alongside federation's agent-session capability. The receiving host passes it to the shared executor and retains its own provider, workspace, and admission checks. Older peers keep their existing terminal contract, and the receipt reports the terminal surface and the coordinator's preferred mode honestly.New worktrees use the same launch-input mapping as local workers, so setup and configured terminals see the promised chat before the workspace is published. If chat creation fails after workspace creation, the existing recovery-shell path remains available. Definite start failures use the shared chat-close operation: confirmed cleanup removes the chat from saved residual resources, while an unproven close restores the tab and retains the resource entry. Uncertain delivery preserves the session for recovery.
Why
The caller supplies launch intent and the execution host owns admission, session identity, and replay. Reusing Orca's existing paired-launch preference field and shared worker executor removes the terminal assumption without a separate WSL preference policy, provider wrapper, or orchestration store. Intended compatibility difference: older peers retain terminal execution because their existing contract cannot represent structured workers. Intended existing-chat behavior: a chat worker runs every configured terminal command alongside its chat; a terminal worker occupies the first configured terminal and skips that terminal command. Failed-start cleanup also uses the same corrected shared close path for local workers.
No WSL mover modules were changed. Existing WSL-host availability gates still apply. This PR uses the existing connected-host and visible-work path; it adds no wake demand for a stopped WSL host without visible work. Temporary follow-up: worker-start wake demand uses #28972's existing connection-demand mechanism; current refusals tell the user to open a host project or reconnect the host in Settings → Remote Orca Servers.
Linked Issue
Internal WSL native-chat plan, PR 11; builds on #27746.
Visual Proof
Required Windows/WSL Electron comparison and screenshots are pending with the coordinator. This changes the worker surface selected by existing orchestration commands, including setup and configured-terminal behavior.
Testing
e3239a9cdd05a6e84585de862ac6537e3fa95675: PR Checks 38811447122 completed successfully and all substantive jobs passed, but PR checks passed was skipped by the workflow success fast path. The strict aggregate-success readiness condition remains unmet.Live Windows/WSL testing on the earlier head
be102df471frecorded 10 passes across structured Claude/Codex workers, same-host workers, existing/new workspaces, initial prompt/mail/question/reply/status, stop/release, lost-reply reconciliation, failed setup, old-peer terminal receipts, and stopped-host refusal. That run reached structured workers only after manually enabling chat in the guest profile; this follow-up removes that requirement, so the coordinator-preference scenario needs a fresh run with the guest default left off. The run also found a separate host-restart pairing failure that makes saved dispatches unavailable; that issue is being fixed in a separate PR and is unchanged here.Validation used CI and the staged-file pre-commit hook; no standalone local lint, typecheck, test or build ran. The first follow-up CI attempt identified only a file-length violation, corrected by moving unchanged protocol-version selection beside its existing capability constants.
Review
Full independent review covered caller preference ownership, execution-host admission, SSH and folder workspaces, mixed-version negotiation, saved-identity reconciliation, setup and cleanup evidence. Two confirmed review findings were repaired through the shared launch and close mechanisms. The inherited resource-recording gap remains owned by #20805; deterministic task-title metadata parity and a partial-capability concern remain deferred. Final production review found no new issues; later fixture-only corrections were checked against their CI failures without changing the original assertions. All substantive current-head CI jobs pass, but the aggregate was deliberately skipped. Windows/WSL screenshots and SSH evidence remain required before readiness; the review status comment records the exact limits.
Agent skill upstream boundary
Notes
No provider-specific launch wrapper or new stream opcode. Remote loss of contact remains
unverifiable.Checklist