Repository navigation
Conversation
This was referenced Nov 9, 2026
Jinwoo-H
added a commit
that referenced
this pull request
Nov 9, 2026
# Conflicts: # src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts
A server that prefers chats now starts a remote worker as a chat, the same way a local start does. The chat takes its task as its first turn (after a wait-for-setup setup finishes), reports home over the relay (mail, turn stops, worker_done), takes its coordinator's mail as new turns, and closes on stop or release, including automatic release. Reading a remote chat worker's state says plainly that it is not supported yet.
…nows one A new federated protocol version 5, sent only when the server advertises orchestration.federation-chat-workers.v1, says the home understands a chat worker. An older home gets a terminal, exactly as before, so its receipt never calls a chat a terminal.
Jinwoo-H
force-pushed
the
jinwoo/orch-stage2-remote-follow-up
branch
from
November 9, 2026 08:49
f91ab49 to
31f28d6
Compare
Jinwoo-H
force-pushed
the
jinwoo/orch-stage2-remote-chat-workers
branch
from
November 9, 2026 08:49
063a3df to
ba767ed
Compare
Contributor
Author
|
Closing in favour of a different design. A worker started on a paired server will become an ordinary worker owned by that server, and the coordinator's computer forwards commands and records results. Follow-ups, chat workers and reads then use the same code as local workers, instead of a separate remote path. The test scenarios from this PR carry over to that work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
If a server is set to open agents as chats, a worker you started there from another computer still opened as a terminal. Now the server picks chat or terminal from its own settings, the same way it does for workers started on it directly. The chat worker gets its task, reports home, takes its coordinator's messages and closes when stopped or released, like a local chat worker.
Stacked on #40123 (base branch
jinwoo/orch-stage2-remote-follow-up).What Changed
Before (A is paired to server devB; devB is set to open Claude as a chat):
After:
Reading a remote chat worker (
worker-showlive state,worker-read, its output) is not supported yet and says so plainly instead of showing a wrong state. A follow-up PR adds it, and adds reusing an existing chat with--on <server> --terminal orca_session_id:<id>.Mechanism (server side, reusing the local paths, no remote-only copies):
federationAttachStartdecides the mode withdecideWorkerStartMode/resolveWorkerStartModeOnHostand launches throughexecuteAgentLaunchwith the same chat-session factory local workers use (createStructuredWorkerSessionForWorktree). A new worktree with a wait-for-setup policy waits for setup before the chat takes its task. The brief is the chat's first turn; if the chat hasn't taken it yet, the start is reported unknown (not failed) and the chat stays for the worker to report.dispatch:mailbox that is only a remote attachment now resolves to its chat while the attachment is ready and exact, so the coordinator's relayed mail arrives as a turn. Turn stops of a remote chat report home through the existing remote turn-stop report.releasingcommit and working-agent deferral a local chat release uses.orchestration.federation-chat-workers.v1. The server starts a chat only for a version-5 request; anything older gets a terminal through the sameterminalOnlylaunch main uses. The receipt carriesmode, and the home shows the server's mode. Older servers send no mode, so the home keeps its own.Why
This removes the remote-only terminal fallback so a remote start follows the server's own chat or terminal setting, the same as a local start. All the per-kind behaviour comes from the code local chat workers already use.
Linked Issue
Part of the cross-machine orchestration plan (gap W2).
Visual Proof
N/A: no UI change. CLI before/after is above.
Testing
worker-start --on <server>, the worker sends a status note and ends its turn, the coordinator sends it one more instruction, the worker sendsworker_done, thenworker-showandworker-release.mode: structured. The note, the turn-stop report, the coordinator's message (as a new chat turn),worker_done, the plain unsupported-read reason and the release (closed_agent_terminal) all worked.origin/mainserver set to chats:mode: terminal(the Before above), and the same flow works as it does today.origin/mainhome and a new server set to chats: a real terminal worker (term_…), and itsworker_donesettled.remote-chat-worker-attach.test.tshas 10 cases. They cover start as a chat, mail home, a turn-stop report, coordinator mail as a new turn, the plain refusal from show, read and read-output, stop, release after the report, automatic release, a new worktree waiting for setup, and a terminal for a request from an older home.pnpm tc:node, the orchestration suites (1203 tests), and the changed-code quality gate pass.pnpm check:changedpassed 25/25 on the main commit. After the protocol-gate commit (which touches a shared capabilities file and so runs the full suite), it passed 26/27: the unit-test failures wereserver-hook-session-binding.test.ts, which also fails onorigin/mainon this machine, and three files that pass when run alone on both this branch and its base. A Codex adversarial review found two P1s and a P2: automatic release never committed toreleasing, a new-worktree chat skipped the wait-for-setup gate, and live reads reported a changed identity. All three are fixed here; the delta review verdict was ship. A follow-up commit gates chat workers on the home's protocol version.Risk
Level: Medium
--terminal) is refused with a plain message until the follow-up PR lands.dispatch:mailbox with no local Dispatch row; local mailboxes resolve as before.orchestration.federation-chat-workers.v1.Review
Self-review plus an adversarial Codex review of the commit and its fix delta; final verdict ship.
Agent skill upstream boundary
Checklist
pnpm check:changedresults are above; CI covers the rest