Repository navigation
Conversation
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit 8b3377a on Jul 1, 2026 3:45pm UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/runtime/rpc/methods/orchestration-gates.test.ts (1)
89-106: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMissing coverage for the genuinely-active-coordinator throw path.
Both tests cover the "no live coordinator" recovery branch. Neither test exercises the sibling branch in
orchestration.run(if (activeCoordinator) throw ...), which is the actual concurrency guard this PR's conditional restructuring depends on. Worth adding a case whereactiveCoordinatoris set (e.g. callorchestration.runtwice without resolving the first) and assert the second call throws.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5dc54b30-f2ee-4684-9400-d81a4617a73b
📒 Files selected for processing (2)
src/main/runtime/rpc/methods/orchestration-gates.test.tssrc/main/runtime/rpc/methods/orchestration-gates.ts
Summary
Reconcile coordinator lifecycle state when the durable DB row says a run is still
runningbut the process-local coordinator handle is gone.This changes the RPC boundary so:
orchestration.runmarks a stale durablerunningrow asfailedbefore accepting a new coordinator run.orchestration.runStopmarks a stale durablerunningrow asfailedwhen there is no live coordinator to stop.Root cause / impact
Coordinator run status is persisted in SQLite, but the object that can advance or stop a run is process-local memory. If Orca exits while a run is active, the next process can see a durable
runningrow without any live coordinator behind it. That stale row blocks new orchestration, and stop previously reported success without reconciling the row.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test- full suite ran with 23,148 passing tests and one unrelated timeout insrc/main/startup/run-electron-vite-dev.test.ts; the failed test passed when reproduced standalone.pnpm buildAdditional focused checks run:
pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration-gates.test.tspnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration.test.ts src/main/runtime/orchestration/db.test.ts src/main/runtime/orchestration/coordinator.test.tspnpm exec vitest run --config config/vitest.config.ts src/main/startup/run-electron-vite-dev.test.ts -t 'rebuilds the copied Electron app when Chromium resources are missing'pnpm exec oxfmt --check src/main/runtime/rpc/methods/orchestration-gates.ts src/main/runtime/rpc/methods/orchestration-gates.test.tspnpm exec oxlint --format github src/main/runtime/rpc/methods/orchestration-gates.ts src/main/runtime/rpc/methods/orchestration-gates.test.tspnpm run typecheck:nodepnpm exec lint-stagedAI Review Report
Review checked macOS, Linux, and Windows compatibility; local, remote, and SSH workflows; supported agent and integration compatibility; performance risk; UI impact; and basic security risk. The change is DB-state reconciliation in the existing RPC lifecycle path, with no platform-specific paths, shell behavior, shortcuts, UI changes, or provider-specific behavior. Performance impact is limited to an existing active-run lookup plus a single status update only on lifecycle commands.
Security Audit
No new command execution, path handling, auth, secrets, dependency, or user-input parsing surface is added. The SQL write uses the existing
updateCoordinatorRunhelper with the already-known run ID. The change only corrects stale lifecycle state for a run that no live coordinator can advance.Notes
Local build emitted existing/non-patch warnings: baseline oxlint warnings in unrelated files, Vite dynamic-import/chunk-size warnings, a local
/usr/local/bin/orca-devsymlink permission warning, and a macOSCGWindowListCreateImagedeprecation warning in native code. GitHub profile has no public X handle listed.ELI5
Coordinator runs could stay “running” in the DB after the process handle was gone. Stale runs are marked failed on new start or stop so orchestration doesn’t hang forever.