Skip to content

fix(orchestration): stop minting and printing the dispatch capability - #23994

Merged
Jinwoo-H merged 19 commits into
mainfrom
dispatch-capability-stop-minting
Sep 30, 2026
Merged

Jinwoo-H merged 19 commits into
mainfrom
dispatch-capability-stop-minting

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 38 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​260 $\color{#cf222e}{\Huge{\mathbf{−}}}$​363 $\color{#cf222e}{\Huge{\mathbf{−}}}$​103
Prod 27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​56 $\color{#cf222e}{\Huge{\mathbf{−}}}$​166 $\color{#cf222e}{\Huge{\mathbf{−}}}$​110

ELI5

#23982 made the Orca host stop checking the secret token that supervised workers had to repeat on every report. This PR stops creating the token at all, and stops printing it: preambles and the bundled orchestration skill no longer mention --dispatch-capability. Workers now report with the plain command.

Stacked on #23982 (review that first; this diff is the second commit onward).

What Changed

Before → after:

Before After
worker-start, dispatch --inject, remote workers Mint a dcap_… token, store its hash, paste it into the preamble No token. The preamble's send / ask lines have no --dispatch-capability
Bundled skill (worker-contract.md) Recipes include --dispatch-capability <capability> Recipes don't; "copy the preamble's command exactly" stays, and says an older host adds the flag
ask times out Resume hint echoes the token the caller passed Unchanged: it echoes only a flag the caller passed, which a new preamble never carries (an older host needs it on --resume)
Recovery commands after a lost response Refused to print when argv had the token (every worker lifecycle command) Printed, since new preambles carry no token; the text now says to run it from the same terminal, which is what the host's caller check needs
worker-show for an unsupervised dispatch stage: injected after dispatch --inject (read from the token hash), else context_only Always stage: context_only; Orca keeps no record of the paste, and nothing reads the distinction

Mechanism:

  • The three mint sites stop minting. mintDispatchCapability is deleted: on dispatch --inject it re-pointed the row createDispatchContext had just written with the same pane and process, so its only lasting effect was the hash. prepareStartingWorkerAuthority and prepareRemoteAttachmentAuthority keep their re-point and consumer fencing and return nothing. dispatch-capability-hash.ts is deleted, and the host drops orchestrationCapability from RpcContext, RpcRequest and the in-process SSH CLI bridge, because nothing on the host reads it.
  • Readers that inferred something from capability_hash now read what they meant:
  • The CLI keeps accepting and forwarding --dispatch-capability, so a new CLI still works against an older host that mints and checks it.

Why

Once the host ignores the token (#23982), printing it only costs: secret scanners block commands that contain it, it sits in argv and transcripts, and agents lose it on compaction. Stopping minting removes the last reason for workers to see it.

Alternatives considered:

  • Keep minting, stop printing: leaves dead state and a hash no reader uses.
  • Hide the flag from --help / reject it: would break every older host's preamble. The CLI keeps forwarding it; send and ask usage already omit it.
  • Add an inject_mode column for worker-show: a schema bump for a field with no in-repo consumer.
  • Keep setDispatchConsumer to bump consumer_generation as an "injected" flag: a DB method and transaction whose only effect is a counter used as a boolean.

Mixed versions

Host Client / text Result
New New CLI No token anywhere; the caller-pane and process checks from #23982 apply
New Old CLI Old preambles' flag is forwarded and ignored
Old New CLI The old host mints and verifies; the new CLI forwards the flag its preamble carries, and the ask resume hint echoes it
Old New CLI-bundled skill The skill still says to copy the preamble's command exactly, which includes the old host's flag
New Old client reading worker-show stage reads context_only after dispatch --inject too; no client branches on it
Downgrade to an old host mid-dispatch — A dispatch created by the new host has no hash: local reports fall back to the old host's process check and keep working; a remote worker created by the new host is refused by the old host until it is restarted

No new wire fields. The CLI still sends orchestrationCapability (the shared RuntimeOrchestrationEnvelope) for older hosts; this host parses requests as plain JSON and ignores the extra field.

Linked Issue

Part of STA-8833 (item 1). Items 2 and 3 are out of scope.

Fixes #17632

Refs #23656 (item 1 only), #16903, #12769, #15124. The cancellation convention (decision 7) is in #23983.

Visual Proof

N/A — CLI text and orchestration state change with no UI. The end-to-end transcript below shows the new preamble lines.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

End to end (macOS, headless isolated runtime built from this branch; fake Codex worker started in a tab; worker commands run inside the worker's own terminal): the injected worker_done line and dispatch-show --preamble now read orca-dev orchestration send --from <worker> --type worker_done … --task-id … --dispatch-id … --outcome succeeded. The coordinator reporting as the worker is consumer_fenced; ask copied from dispatch-show --preamble is accepted; the worker's worker_done completes the Task; worker-stop on a user-opened tab ends stop_unknown and the late worker_done completes the Task and moves the worker to succeeded.

Playwright (electron-headless): orchestration-worker-settlement-release-cli, orchestration-worker-transcript-providers and settled-worker-tab-survives-restart (daemon live) pass with the fake agents no longer depending on the token. completed-worker-retirement-resume and settled-worker-tab-survives-restart (daemon exited) fail identically on main at a0abcb6818b, before the lines this PR touches: the fake Codex also sees a codex --help spawn.

Unit: preamble tests assert no --dispatch-capability or dcap_; worker-start, composed-worker, new-worktree and federation tests assert the prompt carries no token and capability_hash stays null; worker-start-unobserved-prompt-settlement gains a case that a stalled start keeps the identity its authority attached (fails with the old capability_hash IS NULL predicate); manual-dispatch-observation expects stage: context_only; consumer-fencing suites re-point through a test fixture; orchestration-skill-guidance.test.mjs asserts the recipes carry no flag.

Commands run:

  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/main/runtime src/main/ssh src/main/ipc src/cli src/shared config/scripts/orchestration-skill-guidance.test.mjs — all pass except fish-shell tests that depend on the local fish install
  • pnpm run typecheck:tsc:node, pnpm run typecheck:tsc:cli — clean
  • oxlint on changed files, pnpm run audit:anti-slop, pnpm run check:code-quality:changed, pnpm run verify:bundled-skill-guides, pnpm run verify:skill-bundle-manifest — clean

Windows ("windows 2", Git Bash, worktree at 3a5443552e, which includes this change): vitest run over src/main/runtime/orchestration, .../rpc/methods/orchestration/messaging, and orchestration-mutation-recovery — 144 files pass. orchestration-mutation-recovery.test.ts fails 3 cases with Windows argument quoting ("orca-dev" "orchestration" …); main's copy of that file fails the same 3 cases on the same machine, because the test doesn't pin process.platform.

Not tested: a live SSH/connected-server worker end to end.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Follow-ups left out on purpose: deleting the dcap_ transcript redaction and the capability_hash = NULL writes on remote attachments waits for a downgrade window (they keep rows minted by older hosts safe); the preamble can later drop --from and let the CLI use its own identity (#14570).

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)

…ability

Worker lifecycle reports and questions no longer depend on the per-dispatch
capability token that lives only in the agent's conversation. The host now:

- ignores capability_hash/capability_revoked_at for authorization on every
  row and checks the exact worker process instead (ask gains that check);
- refuses a report whose calling terminal is provably another orchestration
  party (a Run coordinator or another Dispatch's worker), treating env that
  names no live pane here as absent;
- applies one worker-state rule locally and remotely: a stop in flight
  refuses, while stop_unknown and start_unknown accept and settle.

Minting and printing the flag are unchanged, so an older host and older
preambles keep working.
Dispatches no longer mint a per-Dispatch token, and preambles, the bundled
skill guide and the ask resume hint stop printing --dispatch-capability. The
consumer-generation bump and delivery fence that minting carried stay, now
as setDispatchConsumer. Readers that inferred meaning from capability_hash
read what they meant instead: worker-show's injected stage comes from the
attached consumer, and a failed start copies custody identity only when no
authority was ever attached. The CLI keeps accepting and forwarding the
flag for older hosts.

Cancelling a Task is recorded as failed with a reason; task-list now shows
that reason and the guide and task-update notes document the recipe.
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Removes dispatch capability minting and validation from orchestration.

The PR appears safe to merge, with non-blocking inaccuracies in the new credential notices and antivirus report and an outstanding worker-stage display issue.

Findings

  1. P2 Migrated injections appear uninjected. ▶

Summary

The PR removes dispatch-capability minting and its worker-facing commands while retaining CLI compatibility with older hosts. Changes since the previous review also replace the Windows CLI launcher, add Linux keyring selection and credential-protection notices, introduce an antivirus artifact report, and remove numerous tests.

  • The new credential notices can remain stale after some protection changes.
  • The antivirus report can label an analysis with zero engine results as clean.

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

state: 'unsupervised' as const,
stage: dispatch.capability_hash ? 'injected' : 'context_only',
// Why: only `dispatch --inject` attaches a consumer to a Dispatch that has no worker row.
stage: dispatch.consumer_generation > 0 ? 'injected' : 'context_only',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Migrated injections appear uninjected. An injected manual Dispatch created before consumer generations were introduced can have a capability hash but a generation of zero: the migration adds that column with a zero default and does not recover injection history. Using generation alone changes its worker-show stage from injected to context_only, making the displayed stage unreliable for those existing Dispatches.

@pullfrog pullfrog 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.

ℹ️ No critical issues — one incomplete skill cleanup, plus a couple of stale test remnants.

Reviewed changes

  • Capability minting removed — mintDispatchCapability becomes setDispatchConsumer (still bumps consumer_generation, fences unacked deliveries, returns void); dispatch-capability.ts / dispatch-capability-hash.ts deleted; prepareStartingWorkerAuthority and prepareRemoteAttachmentAuthority stop writing capability_hash.
  • Preamble no longer prints the flag — buildDispatchPreamble drops dispatchCapability; the worker contract, ask resume hint, and recovery text are updated.
  • worker-show stage re-sourced — an unsupervised Dispatch's injected/context_only now reads consumer_generation > 0 instead of capability_hash.
  • Failed-start identity guard — recordFailedStartDispatchIdentity now keys on process_incarnation IS NULL, with a new test that fails on the old predicate.
  • Cancellation convention — task-list appends a failed Task's result, and task-update docs plus the skill describe failed + result: cancelled.
  • Test/e2e updates — capability plumbing removed across federation, current-authority, commit-notify, SSH-bridge, and completed-worker fixtures.

ℹ️ Two bundled-skill spots still tell workers to preserve a capability argument

worker-contract.md now says "keep any other flag it carries (an older Orca host adds --dispatch-capability)", but two other bundled guides still name a capability argument the preamble no longer carries: orchestration.md ("Workers use the exact executable, handle, capability, Task ID, and Dispatch ID in the live preamble") and messaging-and-gates.md ("a dispatched worker instead copies the exact --from and capability arguments in its preamble"). Both are served to workers, so a worker on a new host reads guidance for an argument that isn't there. A one-line reword in each matches the worker-contract.md treatment.

ℹ️ Nitpicks

  • worker-start-readiness-settlement.test.ts still passes dispatchCapability: 'capability' inside its as never args object; the field is now ignored.
  • orchestration-structured-worker-start-failure.test.ts stubs prepareStartingWorkerAuthority: () => 'capability' even though the method now returns void.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…nt party

- One module owns the unproven/settleable worker states and the refusal rule; local send records it, ask and remote throw it. A stale process is worker_identity_changed on every path.
- The caller fence passes the worker's own terminal when its --from handle went stale.
- Document the shared-tmux-server limit; drop the dead dispatch_capability_invalid rejection member; tests assert dispatch state, not the capability column.
…y' into dispatch-capability-stop-minting

# Conflicts:
#	src/cli/bundled-skill-guides.ts
…lity retention

- dispatch --inject no longer re-points the row createDispatchContext just wrote; worker-show reports every worker-less Dispatch as context_only, since Orca keeps no record of the paste. Tests re-point through a fixture.
- failWorkerStart always records when the lifecycle closed; nothing authorizes on it.
- Restore the ask resume hint's echo of a passed --dispatch-capability: an old host checks it before --resume.
- Move the cancellation convention to #23983.

@pullfrog pullfrog 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.

ℹ️ No issues in the new code — the increment is a clean refactor. One description mismatch to fix.

Reviewed changes

Since the prior review at 3a54435, commit 3f8c829 refactors and reverts several parts of the PR:

  • Production setDispatchConsumer removed — dispatch --inject no longer re-points the row createDispatchContext just wrote; it already carries assigneePaneKey/processIncarnation, so report authority and mailbox generation reads stay consistent. The re-point survives only as a reattachDispatchConsumer test fixture.
  • worker-show stage simplified — every worker-less Dispatch now reports context_only; the consumer_generation > 0 ? 'injected' : … sourcing is gone.
  • failWorkerStart drops retainCapability — capability_revoked_at is now always recorded, and nothing reads it.
  • ask resume hint restored — it echoes a passed --dispatch-capability again, for an older host that verifies it before --resume.
  • Cancellation convention removed from this PR — the task-list failure-reason output, the task-update notes/spec, and the skill docs moved to #23983.

ℹ️ The PR description still describes the pre-3f8c829 changes

The body and the "What Changed" table were written before commit 3f8c829, so they now promise three things the diff no longer does: the task-list cancellation reason and task-update guidance (moved to #23983), the ask timeout hint not echoing the token (restored for old hosts), and worker-show sourcing injected/context_only from consumer_generation > 0 (now always context_only). Reviewers reading the description will look for behavior the branch doesn't have.

Technical details
# Update the PR description to match the head commit

## Affected sites
- PR description, `ELI5` and "What Changed" table — claims cancellation is a readable `task-list` outcome and that `task-update` documents it.
- PR description, "`ask` times out" row — says the resume hint has no token; `question-handler.ts:98-113` now echoes a passed `--dispatch-capability`.
- PR description, mechanism bullet on readers — says `worker-show` reads `stage` from `consumer_generation > 0`; `worker-observation.ts:181` now hardcodes `context_only`.
- PR description, "Testing" section — references `orchestration-task-list-failure-reason.test.ts` and `manual-dispatch-observation` keeping `stage: injected`, both removed/changed.

## Required outcome
- The description matches the diff at `3f8c829`: cancellation explicitly deferred to #23983, the `ask` hint described per its restored behavior, and `worker-show` described as always `context_only` for worker-less Dispatches.

## Suggested approach (optional)
- Reuse the commit body of `3f8c829`, which already enumerates exactly these four deltas.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…y' into dispatch-capability-stop-minting

# Conflicts:
#	src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts
…p test fixtures

- RpcRequest and the SSH bridge stop carrying orchestrationCapability; the CLI's wire field stays for older hosts.
- Fixtures pass identity to createRootDispatch instead of re-pointing to the same values; drop absence checks for a flag that can no longer be produced.

@pullfrog pullfrog 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.

ℹ️ No new code issues — the increment is a clean refactor. A few capability-cleanup remnants remain.

Reviewed changes

Since the prior review at 3f8c829, two commits landed: c43e6a5 merges the advanced base, and 60b9005 is the refactor.

  • Removed the internal RpcRequest.orchestrationCapability — the main-runtime request type no longer carries the field. The wire envelope (RuntimeOrchestrationEnvelope) and the src/cli send/ask handlers still forward it, so an older host keeps receiving the flag.
  • SSH relay bridge stops forwarding the capability — ssh-remote-orca-cli.ts now passes compatibilityEnvelope through and drops the per-call orchestrationCapability, consistent with the host ignoring it.
  • Test identity set at creation instead of re-pointing — current-authority, mutation-ledger, runtime-update-settlement, and send-dispatch-authority tests pass paneKey/processIncarnation to createRootDispatch rather than reattachDispatchConsumer; the latter stays a fixture for suites that genuinely fence a consumer.
  • Tautological absence checks dropped — preamble/federation/new-worktree prompts no longer assert the absence of a flag that can no longer be produced, and capability_hash: null expectations are gone.
  • Base merge — c43e6a5 brings the base branch's removal of the expectDispatchActive helper and the pre-upgrade-capability test; identity coverage survives in send.test.ts and worker-report-authority.test.ts.

Verification: ran the 17 changed unit-test files (preamble, send, composed-workers, manual-dispatch-observation, worker-interactive-wait, worker-start-prompt-contract, workers-new-worktree, orchestration-current-authority-precedence, orchestration-mutation-ledger, orchestration-runtime-update-settlement, orchestration-worker-dispatch-db, ssh-remote-orca-cli, db-task-dispatch-lifecycle-guards, send-dispatch-authority, and the three federation suites) — 276 passed.

ℹ️ The capability cleanup is still incomplete

60b9005's stated goal is dropping no-op capability fixtures, but it leaves two in place, and two bundled guides still tell workers to copy a "capability" argument the preamble never carries. The description also still claims the internal field survives.

Technical details
# Finish the capability cleanup

## Affected sites
- `src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.test.ts:45` — still passes `dispatchCapability: 'capability'` in the no-longer-needed args object.
- `src/main/runtime/orchestration-structured-worker-start-failure.test.ts:113` — still stubs `prepareStartingWorkerAuthority: () => 'capability'`, a method that now returns `void`.
- `skill-guides/orchestration.md:52` — "Workers use the exact executable, handle, capability, Task ID, and Dispatch ID in the live preamble".
- `skill-guides/orchestration/references/messaging-and-gates.md:39` — "a dispatched worker instead copies the exact `--from` and capability arguments in its preamble".
- PR description, "Mechanism" bullet and "No new wire fields. `RpcRequest.orchestrationCapability` stays" line — the field was removed by `60b9005`.

## Required outcome
- Drop the two no-op test fixture fields.
- Reword the two bundled guides to drop "capability", mirroring `worker-contract.md` (which now says only that an older host adds the flag).
- Update the description so it reflects the removed internal field and the SSH-bridge change; `RuntimeOrchestrationEnvelope.orchestrationCapability` is the field that remains for older hosts.

## Note
- The two guide lines were raised in the initial review and are unchanged by these commits; they are flagged again only because this commit's stated scope is a capability cleanup.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Since the prior pullfrog review at 60b9005, commit 07b297e finishes the capability cleanup that review asked for — no production behavior change.

  • Bundled skill guides reworded — orchestration.md and messaging-and-gates.md no longer tell workers to preserve a "capability" argument the live preamble cannot carry; both now say the worker keeps whatever flags the preamble does carry.
  • Embedded guides regenerated — bundled-skill-guides.ts carries the reworded strings; verify:bundled-skill-guides passes clean.
  • No-op test fixtures removed — worker-start-readiness-settlement.test.ts drops the ignored dispatchCapability: 'capability' arg, and orchestration-structured-worker-start-failure.test.ts stubs prepareStartingWorkerAuthority as () => {} to match its void return.
  • PR description updated — the body now describes the removed RpcContext / RpcRequest field and the SSH-bridge change, with RuntimeOrchestrationEnvelope.orchestrationCapability named as the field kept for older hosts.

Verified locally: verify:bundled-skill-guides (exit 0), orchestration-skill-guidance.test.mjs (29 passed), and the two touched test files (3 passed). Remaining dcap_ / dispatchCapability references in src/cli handlers and transcript-redaction tests are the intentional older-host compatibility path documented in the body.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H changed the base branch from worker-reports-without-capability to main September 30, 2026 17:02
…top-minting

# Conflicts:
#	src/cli/bundled-skill-guides.ts
#	src/main/runtime/orchestration/coordinator-dispatch-unobserved-prompt.test.ts
#	src/main/runtime/orchestration/db-task-dispatch-invariant.test.ts
#	src/main/runtime/orchestration/db-task-dispatch-lifecycle-guards.test.ts
#	src/main/runtime/orchestration/db/dispatch-context/dispatch-capability.ts
#	src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-authority.ts
#	src/main/runtime/orchestration/worker-start-unobserved-prompt-settlement.test.ts
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f73517ef-bbe1-463a-b444-ba712800b80d

📥 Commits

Reviewing files that changed from the base of the PR and between e038704 and 275b5ed.

📒 Files selected for processing (65)
  • config/scripts/orchestration-skill-guidance.test.mjs
  • skill-guides/orchestration.md
  • skill-guides/orchestration/references/messaging-and-gates.md
  • skill-guides/orchestration/references/worker-contract.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/orchestration-mutation-recovery.test.ts
  • src/cli/orchestration-mutation-recovery.ts
  • src/main/runtime/orchestration/coordinator-dispatch-unobserved-prompt.test.ts
  • src/main/runtime/orchestration/db-task-dispatch-invariant.test.ts
  • src/main/runtime/orchestration/db-task-dispatch-lifecycle-guards.test.ts
  • src/main/runtime/orchestration/db-task-dispatch-races.test.ts
  • src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts
  • src/main/runtime/orchestration/db/dispatch-capability-hash.ts
  • src/main/runtime/orchestration/db/dispatch-context/dispatch-capability.ts
  • src/main/runtime/orchestration/db/dispatch-mailbox-consumer-fencing.test.ts
  • src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-authority.ts
  • src/main/runtime/orchestration/db/orchestration-db-methods.ts
  • src/main/runtime/orchestration/db/root-dispatch-test-fixture.ts
  • src/main/runtime/orchestration/db/schema/derived-delivery-migration.test.ts
  • src/main/runtime/orchestration/db/worker-dispatch/worker-dispatch-authority.ts
  • src/main/runtime/orchestration/db/worker-dispatch/worker-dispatch-outcome.ts
  • src/main/runtime/orchestration/db/worker-terminal/failed-start-dispatch-identity.ts
  • src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts
  • src/main/runtime/orchestration/preamble.test.ts
  • src/main/runtime/orchestration/preamble.ts
  • src/main/runtime/orchestration/types.ts
  • src/main/runtime/orchestration/worker-start-unobserved-prompt-settlement.test.ts
  • src/main/runtime/rpc/core.ts
  • src/main/runtime/rpc/dispatcher.ts
  • src/main/runtime/rpc/methods/orchestration-structured-worker-start-failure.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-message-targeting.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-output.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/check-worker-consumer-fencing.test.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/run-bound-mailbox-safety.test.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/send-dispatch-authority.test.ts
  • src/main/runtime/rpc/methods/orchestration/runs/dispatch-methods.ts
  • src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/deliver-worker-dispatch-preamble.ts
  • src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts
  • src/main/runtime/rpc/methods/orchestration/worker/manual-dispatch-observation.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-interactive-wait.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-observation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-budget.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-receipt.ts
  • src/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.ts
  • src/main/runtime/rpc/orchestration-commit-notify-characterization.test.ts
  • src/main/runtime/rpc/orchestration-current-authority-precedence.test.ts
  • src/main/runtime/rpc/orchestration-mutation-ledger.test.ts
  • src/main/runtime/rpc/orchestration-runtime-update-settlement.test.ts
  • src/main/runtime/rpc/orchestration-task-dispatch-invariant.test.ts
  • src/main/runtime/rpc/rpc-streaming-dispatcher.ts
  • src/main/runtime/structured-chat-coordinator-mail.test.ts
  • src/main/ssh/ssh-remote-orca-cli.test.ts
  • src/main/ssh/ssh-remote-orca-cli.ts
  • tests/e2e/completed-worker-retirement-resume.spec.ts
  • tests/e2e/helpers/completed-worker-retirement-fixture.ts
  • tests/e2e/orchestration-worker-settlement-release-cli.spec.ts
  • tests/e2e/orchestration-worker-transcript-providers.spec.ts
  • tests/e2e/settled-worker-tab-survives-restart.spec.ts
💤 Files with no reviewable changes (13)
  • src/main/runtime/rpc/rpc-streaming-dispatcher.ts
  • src/main/runtime/orchestration/db/dispatch-capability-hash.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.test.ts
  • src/main/runtime/rpc/methods/orchestration/runs/dispatch-methods.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-budget.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-interactive-wait.test.ts
  • src/main/runtime/orchestration/db/orchestration-db-methods.ts
  • src/main/runtime/rpc/dispatcher.ts
  • src/main/runtime/rpc/methods/orchestration/worker/deliver-worker-dispatch-preamble.ts
  • src/main/runtime/orchestration/db/dispatch-context/dispatch-capability.ts
  • src/main/runtime/rpc/core.ts
  • src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/send-dispatch-authority.test.ts

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


📝 Walkthrough

Walkthrough

The change removes Dispatch capability creation and transport from worker setup, generated commands, RPC requests, and SSH compatibility paths. Dispatch authority preparation now returns no capability, and worker preambles omit the capability flag. Tests and guidance are updated to reflect these changes. The change also updates keyed retry guidance to specify using the same terminal.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 275b5

This change stops issuing per-dispatch capability tokens and relies on worker identity and lifecycle checks instead. No concrete defect was found. Live remote or SSH worker behavior was not exercised end to end, so owners should watch that path after merge.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 275b5

Removing the unused secret reduces its exposure in worker instructions without further weakening the inspected authorization checks. No introduced authorization bypass was established, but remote caller identity and some recovery and compatibility paths remain incompletely verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected sensitive outcomes are task completion or failure and dispatch liveness. A lifecycle report selects an individual dispatch and must satisfy its task association and state checks. If claimed-handle spoofing is externally reachable, repeated requests could affect multiple known dispatches accessible through the same host; a complete cross-host exposure bound was not established.

Security Findings and Attack Paths

  • inferred — A conditional path remains from a claimed sender handle, through absent caller evidence, to runtime lookup of that handle's pane/process identity and report admission. The inspected fence and admission logic predate this PR. No introduced or worsened exploit was established, and complete transport and compatibility enforcement remains unresolved.

Trust Boundaries and Controls

  • observed — The SSH relay constructs connection authority from its target and connection incarnation, but takes terminal environment values from the request. The host bridge strips local session identity. These controls distinguish remote from local authority, without the inspected relay handler independently binding every claimed terminal to the requesting process.

Resilience and Maintainability Implications

  • observed — Consumer-generation increments and fencing of unacknowledged mailbox deliveries remain part of authority attachment. Removing the capability does not remove these controls against stale consumers or split ownership during attachment.

Hardening Proposals

  • proposed — Consider requiring positive terminal-bound caller verification for remote lifecycle reports, with explicit legacy compatibility handling rather than relying on a fence that permits missing evidence. This is hardening for an existing boundary, not an observed regression from this PR.
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning #17632 requires out-of-band delivery of the Dispatch capability, through ORCA_DISPATCH_CAPABILITY, --dispatch-capability-env, or an equivalent mechanism. The PR removes capability minting and remo… Implement an out-of-band capability path required by #17632. Populate ORCA_DISPATCH_CAPABILITY for dispatched workers or add an equivalent environment-name option, and make orchestration send and related worker protocol calls read that …
Out of Scope Changes check ⚠️ Warning The PR changes behavior that #17632 explicitly excludes. failWorkerStart now always sets capability_revoked_at and no longer accepts retainCapability; the PR also removes the mint and revoke cap… Limit the PR to out-of-band capability delivery and the required readers, preamble, and tests. Keep existing minting and revocation behavior unless a separate linked issue requires changing it. If the no-capability design is intentional, sp…
Docstring Coverage ⚠️ Warning Docstring coverage is 17.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 48 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: removing dispatch capability minting and output from orchestration.
Description check ✅ Passed The description is complete and follows the repository template. It explains the user-visible change, mechanism, rationale, compatibility behavior, linked issues, testing, known failures, platform cov…
Full details: Linked Issues check

Explanation

#17632 requires out-of-band delivery of the Dispatch capability, through ORCA_DISPATCH_CAPABILITY, --dispatch-capability-env, or an equivalent mechanism. The PR removes capability minting and removes the capability from new preambles instead. buildDispatchPreamble emits no capability, and orchestration.dispatch creates the dispatch without minting one. The CLI keeps only the older --dispatch-capability compatibility path. Therefore, this PR does not implement the linked issue's requested capability-delivery mechanism, even though new worker commands no longer contain the literal.

Resolution

Implement an out-of-band capability path required by #17632. Populate ORCA_DISPATCH_CAPABILITY for dispatched workers or add an equivalent environment-name option, and make orchestration send and related worker protocol calls read that value without expanding it into argv. Add automated tests for environment delivery and command execution without a capability literal.

Full details: Out of Scope Changes check

Explanation

The PR changes behavior that #17632 explicitly excludes. failWorkerStart now always sets capability_revoked_at and no longer accepts retainCapability; the PR also removes the mint and revoke capability APIs and changes authority and failed-start handling. These are revocation and lifecycle-authority changes, not capability delivery. The change is therefore broader than the linked issue's stated scope.

Resolution

Limit the PR to out-of-band capability delivery and the required readers, preamble, and tests. Keep existing minting and revocation behavior unless a separate linked issue requires changing it. If the no-capability design is intentional, split the lifecycle-authority and revocation changes into a separately scoped issue and PR.

Full details: Docstring Coverage

Explanation

Docstring coverage is 17.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 48 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Since the prior pullfrog review at 07b297e, the only new commit is 275b5ed, a merge of origin/main. No PR-owned file changed, so there is no new behavior to review.

  • Base retargeted to main — #23982, which this PR was stacked on, is now merged into main as e0387040, and 275b5ed merges it in. Restricted to the PR's files, git diff b2320c0..275b5ed is empty (the merge touched only 259 base-owned files), and the net diff against main is unchanged (65 files, +316/−529).

ℹ️ The description still frames this PR as stacked on #23982

The body opens with "Stacked on #23982 (review that first; this diff is the second commit onward)". #23982 is now merged into main and this PR targets main, so the diff is no longer "the second commit onward" and there is no separate parent to review first — the sentence now misdescribes what a reviewer is looking at.

Technical details
# Update the PR body's stack note

## Affected sites
- PR description, second line — "Stacked on #23982 (review that first; this diff is the second commit onward)".

## Required outcome
- The body reflects that the base is `main` and #23982 is merged, so the diff is this PR's changes alone.

## Suggested approach (optional)
- State that #23982 has merged to `main`, or drop the line.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 9afd110 into main Sep 30, 2026
56 checks passed
brennanb2025 added a commit that referenced this pull request Sep 30, 2026
bundled-skill-guides.ts conflicted (generated); regenerated from the merged
skill-guides sources. Main dropped the dispatch capability from the preamble
params (#23994) and added a guide line, so the parity test stops passing a
capability and bounds the kernel at main's new length plus the address line.
brennanb2025 added a commit that referenced this pull request Oct 1, 2026
…rker no longer has

#23994 stopped minting the per-dispatch capability, so capability_hash is null.
The --help spawn failure used to stop this test before it got here.
brennanb2025 added a commit that referenced this pull request Oct 1, 2026
…spawn (#24440)

* test(e2e): fake Codex answers the --no-daemon --help probe without a spawn

Since #23933 Orca runs `codex --help` before a path-named Codex launch. The
fakes logged it as an agent spawn and held the probe for its 5 s timeout.
Move the app-server refusal and --help answer into one shared
FAKE_CODEX_LAUNCH_PROBES_SOURCE used by every fake Codex.

* test(e2e): stop asserting the dispatch capability column a current worker no longer has

#23994 stopped minting the per-dispatch capability, so capability_hash is null.
The --help spawn failure used to stop this test before it got here.
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.

[Other]: deliver the Dispatch capability to workers out-of-band (env / --dispatch-capability-env), not as an argv literal

1 participant