Repository navigation
Conversation
|
CI verification for the exact upstream PR commit a1f8a8a against base a5faf19:
The executable workflows ran in temporary fork PR bbingz#2 because untrusted-fork workflows on the upstream PR require maintainer approval. The fork-only track-community-pr job lacks the upstream project token and is not a code gate; the same upstream tracking job passed here: https://github.com/stablyai/orca/actions/runs/29225117929/job/86737537620. |
a1f8a8a to
0eabed9
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a desktop-window status protocol and activation gate for headless serve runtimes. Electron startup synchronizes a headless sentinel, manages activation readiness, and preserves single-instance and quit behavior. Runtime promotion persists eligible PTY bindings, retains SSH session identities, and enables terminal side effects after desktop availability. CLI status and open commands expose and use desktop status. Unit, wiring, reliability configuration, and Electron end-to-end tests cover the lifecycle. 🚥 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 (2)
src/main/index.ts (1)
2070-2072: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueVoid the dropped startup-services promise for consistency.
The rest of this function explicitly
voids unawaited promises (void firstWindowStartupServicesReady.then(...)), but the top-level call here doesn't. Likely harmless today (the underlying promise is designed to resolve, not reject) but inconsistent with the file's own pattern and could trip ano-floating-promises-style lint rule if enforced.♻️ Proposed fix
- startTerminalRuntimeStartupServices() + void startTerminalRuntimeStartupServices()src/main/startup/serve-desktop-activation-wiring.test.ts (1)
15-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAssert anchor indices are found before using them as search baselines.
appReadyIndex/serveIndexare used asfromIndexfor laterindexOfcalls but are never asserted to be>= 0themselves. SinceindexOftreats a negativefromIndexas0, andtoBeGreaterThan(-1)is true for any found index, a broken anchor (e.g.,if (serveOptions) {reformatted) silently degrades these checks to no-ops instead of failing the test — defeating the purpose of the ordering guard on this critical activation wiring.♻️ Proposed fix
const serveIndex = source.indexOf('if (serveOptions) {', appReadyIndex) const ptyReadyIndex = source.indexOf('await localPtyStartupReady', serveIndex) const headlessRegistrationIndex = source.indexOf('registerHeadlessPtyRuntime(', serveIndex) expect(startupIndex).toBeGreaterThanOrEqual(0) + expect(serveIndex).toBeGreaterThanOrEqual(0) expect(startupIndex).toBeLessThan(serveIndex)Apply the analogous
expect(serveIndex).toBeGreaterThanOrEqual(0)guard before thesentinelIndex/rpcIndex/settleIndexcomparisons in the third test as well.Separately, the exact-whitespace literal
'\n startTerminalRuntimeStartupServices()\n'(test 2) is brittle to harmless reformatting (e.g., prefixing the call withvoid) — consider matching on the bare call ('startTerminalRuntimeStartupServices()') without the surrounding indentation/newlines if precise ordering is already covered by theserveIndexcomparison.Also applies to: 34-47
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 17a8d217-0d6c-463d-8e92-1f67f7ed0b17
📒 Files selected for processing (22)
config/reliability-gates.jsoncdocs/superpowers/plans/2026-07-13-headless-serve-gui-activation.mddocs/superpowers/specs/2026-07-13-headless-serve-gui-activation-design.mdsrc/cli/format.tssrc/cli/runtime-client.test.tssrc/cli/runtime/client.tssrc/cli/runtime/status.tssrc/cli/runtime/websocket-transport.test.tssrc/main/index.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/ssh/ssh-remote-cli-format.tssrc/main/ssh/ssh-remote-orca-cli.tssrc/main/startup/serve-desktop-activation-wiring.test.tssrc/main/startup/serve-desktop-activation.test.tssrc/main/startup/serve-desktop-activation.tssrc/main/startup/single-instance-lock.test.tssrc/main/startup/single-instance-lock.tssrc/main/startup/window-all-closed-quit-policy.test.tssrc/main/startup/window-all-closed-quit-policy.tssrc/shared/runtime-types.tstests/e2e/headless-serve-desktop-activation.spec.ts
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tests/e2e/headless-serve-desktop-activation.spec.ts (1)
145-148: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winDrain spawned process pipes to prevent potential test hang.
stdio: 'pipe'without consumingstdout/stderrcan block the activating Electron process if startup output fills the OS pipe buffer (~64 KB on Linux), causingwaitForProcessExitto time out. This was previously flagged and remains unaddressed.🔧 Proposed fix
activatingProcess = spawn(electronPath, getOrcaElectronLaunchArgs(mainPath, false), { env, - stdio: 'pipe' + stdio: 'pipe' }) +activatingProcess.stdout?.resume() +activatingProcess.stderr?.resume()Alternatively, use
stdio: 'ignore'if the output is not needed:activatingProcess = spawn(electronPath, getOrcaElectronLaunchArgs(mainPath, false), { env, - stdio: 'pipe' + stdio: 'ignore' })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bddf8717-a6af-43c2-a735-1bdb6bfc0cd2
📒 Files selected for processing (22)
config/reliability-gates.jsoncdocs/superpowers/plans/2026-07-13-headless-serve-gui-activation.mddocs/superpowers/specs/2026-07-13-headless-serve-gui-activation-design.mdsrc/cli/format.tssrc/cli/runtime-client.test.tssrc/cli/runtime/client.tssrc/cli/runtime/status.tssrc/cli/runtime/websocket-transport.test.tssrc/main/index.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/ssh/ssh-remote-cli-format.tssrc/main/ssh/ssh-remote-orca-cli.tssrc/main/startup/serve-desktop-activation-wiring.test.tssrc/main/startup/serve-desktop-activation.test.tssrc/main/startup/serve-desktop-activation.tssrc/main/startup/single-instance-lock.test.tssrc/main/startup/single-instance-lock.tssrc/main/startup/window-all-closed-quit-policy.test.tssrc/main/startup/window-all-closed-quit-policy.tssrc/shared/runtime-types.tstests/e2e/headless-serve-desktop-activation.spec.ts
🚧 Files skipped from review as they are similar to previous changes (18)
- src/main/startup/window-all-closed-quit-policy.ts
- src/cli/format.ts
- src/main/ssh/ssh-remote-orca-cli.ts
- src/main/startup/window-all-closed-quit-policy.test.ts
- src/main/startup/single-instance-lock.ts
- config/reliability-gates.jsonc
- src/main/startup/serve-desktop-activation.test.ts
- src/main/startup/serve-desktop-activation.ts
- src/main/startup/single-instance-lock.test.ts
- src/main/startup/serve-desktop-activation-wiring.test.ts
- src/main/runtime/orca-runtime.test.ts
- src/cli/runtime/client.ts
- src/cli/runtime-client.test.ts
- src/cli/runtime/status.ts
- src/main/ssh/ssh-remote-cli-format.ts
- src/cli/runtime/websocket-transport.test.ts
- src/main/runtime/orca-runtime.ts
- src/main/index.ts
|
Superseding the earlier CI note after rebasing the PR onto the then-current main. Exact tested pair: Executable code gates:
The workflows ran in temporary fork PR bbingz#3 because upstream untrusted-fork workflows require maintainer approval. The fork-only track-community-pr job is not a code gate and lacks the upstream project token. After these gates completed, main advanced to 5856a9f via unrelated #8483 (three agent-hook files only). A non-mutating git merge-tree check confirms the current main and this PR head still merge without conflicts. |
|
@coderabbitai review\n\nPlease review the current head, including the desktop-quit → headless-adopt → GUI-promote E2E hardening and the fixes for the prior process-pipe and wiring-anchor findings. |
✅ Action performedReview finished.
|
|
@coderabbitai review Exact-head CI is green for current head
The first Windows attempt timed out only in the unrelated |
|
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
6e3d103 to
f243745
Compare
f243745 to
18eaace
Compare
# Conflicts: # config/reliability-gates.jsonc # src/cli/runtime-client.test.ts # src/cli/runtime/client.ts # src/cli/runtime/status.ts # src/main/index.ts # src/main/runtime/orca-runtime.ts # src/main/startup/serve-desktop-activation-wiring.test.ts # tests/e2e/headless-serve-desktop-activation.spec.ts
|
Thanks for the detailed report and implementation. The core change from this PR was incorporated and hardened through #8646 ( |
Summary
orca serveprocess remain the single Electron owner and promote that same process to a desktop window when Orca is opened normally.orca openrequest desktop activation even when the local runtime is already reachable, while keeping remote-paired opens from launching a local desktop.available,openable,initializing,blocked) so the CLI can wait or fail safely instead of recommendingopen -n.Screenshots
No visual change.
Testing
Final pushed HEAD:
6e3d103c73a5760b7dd885aff91b56c581199a79pnpm lintpnpm typecheckpnpm testpnpm buildFocused and lifecycle coverage:
pnpm exec vitest run --config config/vitest.config.ts src/cli/runtime-client.test.ts src/cli/runtime/websocket-transport.test.ts src/main/runtime/orca-runtime.test.ts src/main/startup/serve-desktop-activation-wiring.test.ts src/main/startup/serve-desktop-activation.test.ts src/main/startup/single-instance-lock.test.ts src/main/startup/window-all-closed-quit-policy.test.ts— 7 files, 719 tests passed.ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test tests/e2e/headless-serve-desktop-activation.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1— passed in 1.0m. The test uses one isolated profile and proves: desktop quit -> detached daemon and PTY survive -> headless serve adopts the original PTY -> a normal second launch promotes the same serve owner -> runtime and daemon inventories both remain exactly one original PTY -> the restored terminal still accepts commands.pnpm run build:desktop— passed, including typecheck, relay, CLI, Electron, and web builds.pnpm run build:native— both macOS architecture builds completed, then the existing packaging script failed becauselipocould not find its expected architecture output paths. No native files are changed by this PR.pnpm testattempt under local Node 26 entered unrelated renderer tests and hit the known missing--localstorage-fileenvironment failure; the repository declares Node 24. The affected feature suites above pass directly, and CI remains authoritative for the supported environment.AI Review Report
Reviewed the final diff against current
mainand checked the failure modes behind the incident:second-instance/activaterequests;The review caught a stale startup call after merging current
main; a source-wiring regression test was added first, then the duplicate hook-server startup call was removed. It also expanded the original headless-only E2E into the exact desktop-quit -> headless-adopt -> GUI-promote lifecycle and asserts that both runtime and daemon inventories contain exactly the original PTY.CodeRabbit's current findings were adjudicated against the final source. The valid items were fixed: the dropped startup promise is explicitly voided, wiring-test anchor failures can no longer degrade into false passes, and the activating process no longer owns unread stdout/stderr pipes. A subsequent E2E precondition failure exposed another test false positive: the old PTY probe could accept echoed input before the shell executed it. The lifecycle now waits for a split-marker command round trip whose complete marker only exists in executed output; the final E2E passed with that gate.
Cross-platform review explicitly covered macOS, Linux, and Windows. The Electron single-instance API remains platform-neutral; no shortcut labels or hard-coded separators were added; local executable launch continues through Electron/Node process APIs; SSH activation remains remote-scoped; and platform-dependent quit/window behavior stays behind the existing Electron lifecycle checks.
Security Audit
No security follow-up identified.
Notes
open -nto recover a headless owner. A normal app launch ororca opennow routes activation to the existing owner.