Repository navigation
fix(orchestration): release context-only dispatches - #13376
Conversation
|
@coderabbitai review |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded context-only Dispatch release handling for 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/orchestration-low-level-dispatch-release.spec.ts (1)
27-29: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winGive the incarnation poll an explicit timeout to match the sibling wait.
Line 18 uses
waitForActivePanePtyId(orcaPage), which the helper documentation shows uses a 15-secondtimeoutMs. Line 27 polls forincarnationIdwith no options, so it falls back to Playwright's built-in 5-secondexpect.polldefault. Both waits depend on the same PTY process publishing state after startup. A shorter default on the second wait can make this test flakier under CI load than the first wait, for no functional reason.Pass an explicit timeout to
expect.pollto match the surrounding pattern.🕐 Proposed timeout alignment
await expect .poll(async () => (await findTerminal(client, terminalHandle)).incarnationId) + .toBeTruthy() - .toBeTruthy()Use
expect.poll(fn, { timeout: 15_000 })instead ofexpect.poll(fn)to align with the 15-second budget used one line earlier for a comparable PTY startup wait.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 434aa06e-bf56-401f-a12e-82f525ce3f55
📒 Files selected for processing (11)
config/reliability-gates.jsoncsrc/cli/handlers/orchestration-worker-cli.test.tssrc/cli/handlers/orchestration.tssrc/cli/help.tssrc/cli/specs/orchestration-worker-specs.tssrc/main/runtime/orchestration/context-only-dispatch-release.tssrc/main/runtime/orchestration/db.tssrc/main/runtime/rpc/methods/orchestration-manual-dispatch-release.test.tssrc/main/runtime/rpc/methods/orchestration-worker-control.tssrc/main/runtime/rpc/methods/orchestration-worker-stop.tstests/e2e/orchestration-low-level-dispatch-release.spec.ts
* fix(orchestration): release context-only dispatches Refs stablyai#13005 * test(orchestration): align PTY readiness timeout --------- Co-authored-by: Jinwoo-H <[email protected]>
Summary
Low-level
orca orchestration dispatchcreates a live Dispatch without a supervised worker record.worker-stopandworker-abandonpreviously looked only for the worker record, returneddispatch_not_found, and left the terminal permanently occupied.This change gives those context-only Dispatches a real release path:
stoppedorabandoned, revoke lifecycle authority, close pending questions, and release the exact assignee identityFixes #13005.
Supersedes #13250 with a transaction-scoped release path that does not create synthetic worker rows.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— 48,603 tests passed; five unrelated failures passed immediately in isolation (updater, transcript watcher, relay environment, and daemon cwd coverage)pnpm buildFocused validation on the final rebased commit:
The reliability gate
orchestration.context-only-dispatch-releaseincludes red/green evidence: the Electron oracle reproduceddispatch_not_foundon the pre-fix main commit and passed with this implementation.AI Review Report
Two review/fix rounds were completed. The first found that text-mode
worker-stopomitted the new retained-process warning; the CLI output, help, and regression coverage were updated. Two independent reviewers then returned clean after checking root cause, atomicity, stale/current Dispatch races, first-outcome idempotency, terminal identity safety, supervised/federated isolation, RPC compatibility, and test reliability.The implementation was also compared with synthetic worker rows and a separate release verb. Releasing the existing Dispatch in one database transaction is the smaller ownership-correct design and avoids manufacturing lifecycle/process state that does not exist.
Cross-platform review found no new shortcuts, path handling, shell commands, native modules, filesystem assumptions, or platform branches. The control path is provider-neutral. macOS local runtime behavior is proven; physical Linux, Windows, WSL, SSH, and paired remote-runtime journeys remain explicit evidence gaps.
Performance review found no hot-path regression: release is an explicit control action using indexed lookups and bounded updates, with no polling, subprocesses, process inspection, renderer work, terminal I/O, caches, listeners, or unbounded state.
Security Audit
No dependencies, command execution, path handling, auth flow, secrets, or external network behavior changed. Dispatch IDs continue through the existing validated RPC schema and parameterized database operations. Capability revocation and pending-question closure are part of the same transaction as assignment release. The context-only path deliberately cannot close a terminal process it does not supervise.
Notes
warning; older clients can ignore it. No new stream opcode or required request field was added.