Skip to content

feat(orchestration): release settled workers automatically after a 2-minute grace period - #34744

Closed
Jinwoo-H wants to merge 7 commits into
mainfrom
orch-auto-release
Closed

Jinwoo-H wants to merge 7 commits into
mainfrom
orch-auto-release

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​376 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​363
Prod 63 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1439 $\color{#cf222e}{\Huge{\mathbf{−}}}$​308 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1131

ELI5

When a worker agent reports that it finished (or failed), Orca now closes its terminal by itself about 2 minutes later. Its output is saved first, so worker-read still works. If you or the coordinator want the worker kept, any of these keeps it: reusing it for a follow-up, running worker-retain, typing into it, or picking Keep Worker Open in the tab menu.

What Changed

Before: a finished worker's terminal stayed open until the coordinator ran worker-release. worker-list showed it as reclaimable and its next action was worker-release. Coordinators that forgot this left idle agents open.

After:

  • An accepted worker_done (succeeded or failed) records auto_release_at = now + 2 min, once, in the same settlement transaction. A repeated worker_done never moves it.

  • One runtime timer is set for the earliest deadline. It is reset whenever a settlement records a deadline, and again when the database opens, so a restart picks up deadlines it missed. When it fires, it claims the due rows and hands them to the existing release recovery path (reconcileRequestedWorkerTerminalReleases → completeWorkerTerminalRelease / releaseRemoteAttachment). This PR adds no new archive or close code.

  • The claim (claimDueWorkerTerminalAutoReleases) is a compare-and-set. It only succeeds if all of these still hold:

    • the deadline belongs to the Dispatch that owns the row now (auto_release_dispatch_id = owner_dispatch_id);
    • the row is owned and not_requested;
    • it is due;
    • the worker or remote attachment is succeeded or failed.

    Explicit release overrides a retain on purpose, so the timer never calls it.

  • What wins over the deadline:

    • Reuse with worker-start --terminal: the transfer clears the deadline and changes the owner.
    • worker-retain, and the new Keep Worker Open tab-menu item: both record the same durable user_requested retain.
    • Typing into the terminal. The renderer's and mobile's takeover reports still record takeover as before. If a report never arrives, the automatic close checks for typing itself. Right before it closes the terminal, it reads the terminal's in-memory last-input time, which every user-input path already records. If anyone typed after worker_done, it does not close: the row becomes user_owned and retained, using the existing takeover write. Orchestration mail does not count as typing; a terminal send from the CLI does, since someone drove the terminal. Because this is checked only at close time, typing does no orchestration database work, so the fix(orchestration): fence worker release on mobile keystrokes #19337 invariant still holds. An explicit worker-release still closes the terminal.

    Retain and takeover also win after the claim, while output is being captured: the archive commit refuses a row that is no longer requested.

    Known gap, accepted: the last-input time is in memory. If the takeover report is lost and Orca restarts within the grace period while the terminal survives, the new runtime has no typing history and the automatic release closes it.

  • Never released automatically:

    • escalations, questions, and silence (nothing settles);
    • start_unknown, stopped, and abandoned workers;
    • external terminals and terminals a user took over;
    • rows settled before this change (no deadline is backfilled);
    • chat workers (see below).
  • The deadline appears in:

    • worker-show: autoReleaseAt, and Auto-release: in text output;
    • worker-list: projection.autoReleaseAt for local and remote workers, plus resource.autoReleaseAt for local ones, and auto-release= in text output;
    • the worker_done send receipt: lifecycle.autoReleaseAt.

    While a deadline is pending, the fleet next action is none instead of worker-release.

  • Remote (federation):

    • The execution host records the deadline only when the home's federationAck carries the home's acceptance of the worker_done and the new autoRelease: true flag. A report that is only queued records nothing.
    • worker-retain on the home now goes to the execution host through the new orchestration.federationRetain. Before, it only ran on the home, which owns no terminal.
    • Recovery-mode remote release now only resumes a request that is already committed. Before, it could override a retain that arrived mid-reconcile.
    • Each remote release caller records its own request before joining a close already under way, so an explicit release that overlaps the host timer still clears the automatic deadline. Capture output is published only through the conditional archive commit, so a retain during capture leaves no stale archive for worker-read.
    • Remote release now goes through the same per-resource single-flight as local release (WorkerTerminalReleaseSingleFlight, generalized from completeWorkerTerminalRelease). A home worker-release that overlaps the host timer joins the timer's close instead of closing a second time.
    • When the host releases a worker on its own, the home catches up through the existing observation flow. Host fleet snapshots and federationShow report released, and the home applies the existing applyConfirmedFederatedReleaseHomeProjection inside its observation fence. Fleet snapshots also carry the host's autoReleaseAt, so the home's worker-list --include-remote shows the pending release and a next action of none.
  • Mixed versions: new capability orchestration.worker-auto-release.v1.

    • An older home never sends autoRelease, so a new host keeps manual release.
    • An older host lacks the capability, so the home keeps today's home-only retain, and the old host never closes anything by itself.
  • Schema v44: two nullable columns, auto_release_at and auto_release_dispatch_id, plus a partial index. The deadline is tied to the Dispatch it was set for, so if an older build transfers a terminal, the stale deadline is ignored.

Decisions where the design left room

  • Chat workers ship excluded (terminals only). Retry skips chat handles because a failed chat start is torn down by its own path (failed-worker-start-teardown.ts, fix(orchestration): stop retried failed worker starts from piling up live agents #27795). That reason does not apply to a settled chat. A different one does: no draft-edit activity signal exists on desktop or mobile, and closing the chat would throw away a draft the user is writing. So chats keep manual release until draft edits count as user activity.
  • Keep Worker Open is a pane-addressed RPC (orchestration.workerTerminalUserKeep), shaped like the takeover report. Renderers cannot send the orchestration contract version that workerRetain requires, and naming the pane routes the call to the runtime that owns the terminal. It reuses the same retain write.
  • Grace is 2 minutes, as the council decided.

Why

The release path already archives output and closes only the worker's own terminal, safely. What was missing was a trigger that does not depend on the coordinator remembering to run it. Running the timer through the existing recovery path, behind a fenced claim, keeps one close path. It also means a restart, an unreachable host, or a missing terminal behave exactly like a release that was already requested.

Linked Issue

N/A (maintainer; orchestration simplification idea 5).

Visual Proof

Hidden dev build: ORCA_BACKGROUND_LAUNCH=1, profile under /tmp/oar, isolated HOME and CLAUDE_CONFIG_DIR, a fake Codex. Three workers report worker_done: plain is left alone, retained gets worker-retain, and typed gets real keystrokes in its xterm.

Before deadline After deadline
before-deadline.png after-deadline.png
05:01:18 all three workers settled
$ orca orchestration worker-list
… terminal=reclaimable auto-release=2026-10-28T05:03:18Z next=none   (×3)
$ orca orchestration worker-retain --dispatch ctx_480d…
Worker ctx_480d… terminal [retained] reason=user_requested process=none
05:01:19 typed into the typed worker; takeover recorded
05:03:17 plain worker terminal closed 119s after worker_done settled
05:03:32 retained terminal open=true typed terminal open=true
$ orca orchestration worker-read --dispatch ctx_106e…
Archived: true … ACK worker output for worker-read
$ orca orchestration worker-list
Terminals: retained=2 released=1

Before (main): I did not rebuild main for a side-by-side run. On main, nothing records a deadline, so the same flow leaves all three terminals reclaimable and open until someone runs worker-release.

Testing

  • I manually tested these changes locally (macOS, hidden dev build, above)
  • Automated tests added/updated
    • worker-auto-release.test.ts (on the release harness, fake clock):
      • expiry for succeeded and failed workers, with worker-read after;
      • a repeated worker_done does not extend the deadline;
      • reuse during the grace period;
      • retain, Keep Worker Open, and user input each win;
      • typing while output is being captured wins;
      • a worker retained before it reported is never scheduled;
      • silent, abandoned, and pre-upgrade workers are untouched;
      • typing wins when no renderer report is ever sent, both before the deadline and while output is being captured; typing from before worker_done does not block the release; an explicit worker-release still closes after typing;
      • real restart: a file-backed database is closed and reopened by a fresh runtime. A deadline that passed while the app was closed releases exactly once on open, and output stays readable;
      • a release interrupted while requested or releasing finishes once after the restart;
      • chat workers are never scheduled.
    • federation-output.test.ts (new scenarios in federation-auto-release-scenarios.test-support.ts):
      • the host deadline is recorded only after the home accepts, then the release runs on the host;
      • retain from the home is forwarded to the host;
      • typing on the host after worker_done keeps the terminal;
      • a home worker-release that joins the host timer during capture, or after the archive commit, still closes once, even with typing recorded;
      • a retain during host capture publishes no archive;
      • a home worker-release that overlaps the host timer, with the close held pending, closes once;
      • a host-side release converges the home through worker-list --include-remote and through worker-show;
      • older home → new host keeps manual release;
      • new home → older host keeps retain on the home only.
  • pnpm check:changed --maxWorkers=2 on 99e764c: 27 of 27 checks passed.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Cross-platform: no platform-specific code. The timer is setTimeout, unref'd. Deadlines are UTC SQLite timestamps written from Date.now().
  • Remote/SSH/WSL:
    • The close runs on the runtime that owns the terminal, through the existing release path.
    • After the host releases a worker on its own, the home converges on its next observation of that worker (worker-show or worker-list --include-remote). A plain worker-list, which does not contact hosts, shows the home's last projection.
  • Mobile: mobile typing counts too, because the close-time check reads the input time recorded on the runtime that owns the terminal. There is no Keep Worker Open item on mobile yet.

Follow-ups (out of scope here)

  • Draft-edit activity for chat workers, which stay excluded.
  • Keep Worker Open on mobile, backed by the same retain.
  • Folder workspaces: nothing depends on git.
  • Retained workers still show next=orchestration worker-release in worker-list. That matches main's existing projection for a retained worker.

Guide update

The orchestration guide and its bundled copy now say: terminal workers are released about 2 minutes after worker_done (autoReleaseAt); run worker-retain first to reuse or inspect one later; explicit worker-release still works and is required for chat workers and any worker without autoReleaseAt. Changed: the Completion section of skill-guides/orchestration.md, the reuse recipe in references/coordinator-loop.md, and the action table and retain/release section in references/recovery-and-cleanup.md. The worker preamble now says the terminal stays available until Orca releases it, about 2 minutes after worker_done unless the coordinator retains it.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The changes add automatic release for eligible worker terminals after a two-minute grace period. Database deadlines are armed after worker completion and accepted federation settlements. A runtime scheduler claims due releases and reconciles them. Retention actions can cancel scheduled releases. Worker observations, CLI output, and fleet projections report deadlines, and federation support is capability-gated.

Priority: Normal

Merge Risk: Moderate · up to 99e76

Resolve the completion guidance and output-retention warning before merging: coordinators could leave federated workers unreleased or lose earlier output they expected to inspect. Federated completion receipts still omit the deadline, and an isolated test remains broken.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 36.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: automatic release of settled workers after a two-minute grace period.
Description check Passed The description is complete and directly related to the change. It includes the ELI5 summary, user-facing behavior, implementation details, rationale, maintainer issue exception, visual proof, testing…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and directly related to the change. It includes the ELI5 summary, user-facing behavior, implementation details, rationale, maintainer issue exception, visual proof, testing evidence, compatibility notes, limitations, and follow-ups. Minor unchecked checklist items do not prevent approval because the description provides substantial testing and review information.

Full details: Docstring Coverage

Explanation

Docstring coverage is 36.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 49 functions across 66 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc48d6d2-cdfd-43ee-a4ac-31943ce8d665
Commits

Reviewing files that changed from the base of the PR and between 57c2b53 and cfe18e6.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 50
  • src/cli/handlers/orchestration/message-send-handler.ts
  • src/cli/handlers/orchestration/worker-observation-handlers.ts
  • src/cli/handlers/orchestration/worker-terminal-handlers.ts
  • src/cli/specs/orchestration-worker-specs.ts
  • src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts
  • src/main/runtime/orchestration/db/contract-constants.ts
  • src/main/runtime/orchestration/db/dispatch-context/worker-report-settlement.ts
  • src/main/runtime/orchestration/db/federation/federation-relay-ack.ts
  • src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-release.ts
  • src/main/runtime/orchestration/db/orchestration-db-methods.ts
  • src/main/runtime/orchestration/db/orchestration-db.ts
  • src/main/runtime/orchestration/db/schema/create-core-tables-sql.ts
  • src/main/runtime/orchestration/db/schema/migrate-v44.ts
  • src/main/runtime/orchestration/db/schema/migrate.ts
  • src/main/runtime/orchestration/db/utc-timestamp.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-archive.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-auto-release.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-listing.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-resource-store.ts
  • src/main/runtime/orchestration/db/worker-terminal/worker-terminal-user-takeover.ts
  • src/main/runtime/orchestration/federation-sync.ts
  • src/main/runtime/orchestration/lifecycle-reconciliation.ts
  • src/main/runtime/orchestration/orchestration-schema-version-skew.ts
  • src/main/runtime/orchestration/worker-terminal-auto-release-scheduler.ts
  • src/main/runtime/orchestration/worker-terminal-ownership.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release-host.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-show.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-auto-release-scenarios.test-support.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-control.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-output.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-relay.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-auto-release.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-list-projection.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-observation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-terminal-resource-presentation.ts
  • src/main/runtime/workspaces/persisted-surfaces/automation-operations.ts
  • src/renderer/src/components/tab-bar/KeepWorkerMenuItem.tsx
  • src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/shared/orchestration-fleet-projection.ts
  • src/shared/orchestration-fleet-worker-projection.ts
  • src/shared/orchestration-rpc-contract.ts
  • src/shared/orchestration-runtime-capabilities.ts
  • src/shared/protocol-version.ts
  • src/shared/rpc-contract/orchestration-federation-relay-params.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment on lines +130 to +135
const lifecycle = 'lifecycle' in value ? value.lifecycle : undefined
const autoRelease =
lifecycle && 'autoReleaseAt' in lifecycle && lifecycle.autoReleaseAt
? ` (terminal auto-release at ${lifecycle.autoReleaseAt})`
: ''
return withWarnings(`Sent ${value.message.id}${autoRelease}`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Data Integrity & Integration · Quick win

Include the deadline in federated worker receipts.

A remote worker_done returns the relay variant, so this formatter never prints its deadline. The federated settlement also omits the deadline from the receipt. Add the host deadline to the relay receipt and display it in both text and JSON output. (raw.githubusercontent.com)

? ` next=${projection.nextAction.argv.join(' ') || 'none'}`
: ''
return `${worker.dispatchId} task=${worker.taskId} [${worker.workerState}${details} terminal=${worker.terminalState ?? 'none'}${next}`
const autoRelease = worker.resource?.autoReleaseAt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Data Integrity & Integration · Quick win

Expose remote deadlines in worker-list.

For a federated worker, the deadline is stored on the execution host. worker-list builds resource from the home database, while the remote fleet snapshot contains only liveness. Consequently, even --include-remote omits the deadline, although the terminal will close. Include the host deadline in the fleet snapshot and return it in the worker-list row. (raw.githubusercontent.com)

const h = createOrchestrationWorkerReleaseHarness()

afterEach(() => {
getWorkerTerminalAutoReleaseScheduler(h.runtime).clear()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

afterEach throws when a test does not call h.setup().

The test 'never arms a chat worker…' (Line 192) opens its own OrchestrationDb and never calls h.setup(). afterEach still calls getWorkerTerminalAutoReleaseScheduler(h.runtime). The harness variable runtime is undefined until setup() runs. In a full run it is the stale runtime from an earlier test, which hides the problem.

Run this test alone, for example with -t or .only. schedulerByRuntime.set(undefined, …) then throws a TypeError because WeakMap keys must be objects. The test fails in the hook.

Track whether setup ran, and clear the scheduler only in that case.

🐛 Proposed fix
+  let didSetup = false
+
   afterEach(() => {
-    getWorkerTerminalAutoReleaseScheduler(h.runtime).clear()
+    if (didSetup) {
+      getWorkerTerminalAutoReleaseScheduler(h.runtime).clear()
+    }
+    didSetup = false
     h.cleanup()
     vi.useRealTimers()
   })

   function setupWithFakeClock(): void {
     vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'] })
     vi.setSystemTime(new Date('2026-10-27T12:00:00Z'))
     h.setup()
+    didSetup = true
   }

…s converge with automatic release

- Record worker takeover at the owning runtime when it accepts UI input, before the bytes reach the PTY.
- Run remote attachment releases through the same per-resource single-flight as local ones.
- Apply the confirmed-release home projection when host observation reports a host-side release, and carry the host deadline in fleet snapshots.
- Prove restart recovery with a file-backed database reopened by a fresh runtime.
…remote releases, converge the home

- An automatic close checks the terminal's last driving-input time right before closing and keeps a worker someone typed into after worker_done; typing itself does no orchestration database work.
- Remote releases share the per-resource single-flight with local release, so a home worker-release joins the host timer's close.
- Host fleet snapshots and federationShow report released and the pending deadline; the home applies the existing release projection inside its observation fence.
- Real restart tests: a file-backed database reopened by a fresh runtime releases a missed deadline once and finishes interrupted requests.
…, publish archives only through the conditional commit

- Each remote release caller records its own request before joining a close under way, and the close decides on the current row, so an explicit release that overlaps the host timer clears the automatic deadline.
- Remote capture publishes its archive through commitWorkerTerminalArchiveForRelease, so a retain during capture leaves no stale archive for worker-read.
- Remote worker-show projects the fenced host deadline and its next action.
- The input guard lives in its own module instead of the scheduler.
…r worker_done

- The guide's Completion section, the reuse recipe and the recovery reference now describe the automatic release and its autoReleaseAt deadline: reuse or worker-retain before it; explicit worker-release still works and is required for chat workers and workers without a deadline.
- The worker preamble says the terminal stays available until Orca releases it, about 2 minutes after worker_done unless retained.
- Regenerated the bundled guides.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71d13ebe-d0c9-4a24-88bd-9fe2824b05ba
Commits

Reviewing files that changed from the base of the PR and between a7e5fc3 and 99e764c.

Files ignored due to path filters: 1
  • src/main/runtime/orchestration/__snapshots__/preamble.test.ts.snap is excluded by !**/*.snap
Files selected for processing: 8
  • skill-guides/orchestration.md
  • skill-guides/orchestration/references/coordinator-loop.md
  • skill-guides/orchestration/references/recovery-and-cleanup.md
  • src/cli/bundled-skill-guides.ts
  • src/main/runtime/orchestration/preamble.test.ts
  • src/main/runtime/orchestration/preamble.ts
  • src/main/runtime/rpc/methods/orchestration-worker-start-mode-selection.test.ts
  • src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

it with `task-update --status completed`. Enumerate the terminals still owing a
decision with `worker-list --run <run_id> --terminal-state reclaimable --json`,
and do not end the coordinator turn until it returns none.
and do not end the coordinator turn until every row left has an `autoReleaseAt`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Include federated workers in completion accounting.

A federated worker can have no home terminal resource. worker-list --terminal-state reclaimable then excludes it, even when its host has no automatic-release deadline. The coordinator can end the turn without releasing that worker. Enumerate remote workers separately, check their host deadlines, and release those without one. Regenerate the bundled guide. (raw.githubusercontent.com)

Comment on lines +62 to +63
always needs `worker-release`. Do not retain it only to read output; archived
output remains available through `worker-read`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Data Integrity & Integration · Quick win

Do not promise complete output after release.

The archive preserves a bounded snapshot: transcript capture is limited to 50 messages, and terminal fallback is limited to a tail. Earlier output cannot be recovered through the archived worker-read path. Advise coordinators to read needed output before release or retain the terminal when later inspection matters. Regenerate the bundled guide. (raw.githubusercontent.com)

@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Superseded by #36137, which combines the orchestration v3 changes into one PR.

@Jinwoo-H Jinwoo-H closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant