Repository navigation
Keep remote worktree creation from navigating paired clients - #25793
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughWorktree creation and activation now default to host navigation in the relevant runtime and CLI paths. CLI-provenance requests that specify Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Worktree creation with an explicit all-client navigation request now falls back to host background provisioning when the host renderer is unavailable. No concrete merge-blocking risk remains in the reviewed changes. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change reduces unintended control of paired viewers without establishing broader execution privileges. A limited recovery concern remains: creation during a host renderer crash or reload can leave setup and terminal initialization without an available owner. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 31 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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/cli/index-worktree-create-agent.test.ts (1)
84-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUpdate the stale comment above this assertion.
Lines 82-83 say that
--activatemust stay "an explicit all-surface reveal". The assertion now expectsnavigation: 'host'. The comment now describes the opposite of the tested behavior. Change it to state that CLI activation targets the host desktop.Proposed fix
- // Why: the CLI pairs as a runtime device but has no viewer, so --activate must - // stay an explicit all-surface reveal rather than caller-scoped navigation. + // Why: the CLI has no viewer, so --activate targets the host desktop rather + // than navigating paired clients. navigation: 'host',
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c3ad70af-13d8-45e8-8906-aa6d63a3a91c
📒 Files selected for processing (26)
docs/reference/remote-wire-compatibility.mdsrc/cli/handlers/worktree.tssrc/cli/index-worktree-create-agent.test.tssrc/cli/index-worktree-create-target.test.tssrc/main/runtime/multi-client-navigation-isolation.integration.test.tssrc/main/runtime/orca-runtime-activate-managed-worktree.tssrc/main/runtime/orca-runtime-create-managed-remote-worktree.tssrc/main/runtime/orca-runtime-create-managed-worktree.tssrc/main/runtime/orca-runtime-notify-ssh-state-changed.tssrc/main/runtime/rpc/methods/worktree-create-args.tssrc/main/runtime/rpc/methods/worktree-create-navigation.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/main/runtime/runtime-folder-worktree-create.test.tssrc/main/runtime/runtime-folder-worktree-create.tssrc/main/runtime/runtime-local-worktree-terminal-startup.test.tssrc/main/runtime/runtime-local-worktree-terminal-startup.tssrc/main/runtime/runtime-remote-managed-worktree-create.test.tssrc/main/runtime/runtime-remote-managed-worktree-create.tssrc/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge-ownership.test.tssrc/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/worktree-event-runtime-activation.test.tssrc/renderer/src/hooks/ipc-events/worktree-event-runtime.tssrc/shared/runtime-client-events.tssrc/shared/runtime-navigation.test.tssrc/shared/runtime-navigation.tstests/e2e/paired-worktree-activation-isolation.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e8cb8e87-b124-4ce9-8679-8974d98eb5bf
📒 Files selected for processing (16)
docs/reference/remote-wire-compatibility.mdsrc/cli/index-worktree-create-agent.test.tssrc/main/runtime/orca-runtime-create-managed-remote-worktree.tssrc/main/runtime/orca-runtime-create-managed-worktree.tssrc/main/runtime/orca-runtime-get-worktree-terminal-provisioning-host.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.tssrc/main/runtime/orca-runtime-worktree-provisioning-availability.test.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/runtime-folder-worktree-create.test.tssrc/main/runtime/runtime-folder-worktree-create.tssrc/main/runtime/runtime-local-worktree-terminal-startup.test.tssrc/main/runtime/runtime-local-worktree-terminal-startup.tssrc/main/runtime/runtime-remote-managed-worktree-create.test.tssrc/main/runtime/runtime-remote-managed-worktree-create.tssrc/renderer/src/components/right-sidebar/file-explorer-watch-reconcile.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/main/runtime/runtime-remote-managed-worktree-create.test.ts
- docs/reference/remote-wire-compatibility.md
- src/main/runtime/orca-runtime-create-managed-worktree.ts
- src/cli/index-worktree-create-agent.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
# Conflicts: # src/renderer/src/components/right-sidebar/file-explorer-watch-reconcile.test.ts
ELI5
Creating a workspace on a remote Orca host could pull every connected desktop away from its current work and scroll its sidebar to the new workspace. Remote work now appears in the list while each viewer keeps its own selection.
What Changed
Host and CLI worktree creation/activation now target the host desktop by default. Paired desktop creation stays with its caller. Catalog updates still reach all viewers; navigation reaches them only for an explicit
clientsorallrequest.Older CLIs automatically sent
navigation: 'all'for--activate/--run-hooks. The host recognizes the existing CLI provenance marker and normalizes that automatic broadcast. Activation events now carry an optional navigation target, and updated clients ignore unaddressed broadcasts from older hosts. Explicit remote activation resolves the workspace on the publishing host, including when local and remote repository IDs collide.Accepted navigation is canceled if bridge cleanup, reconnection, or re-pairing happens while repository/worktree discovery is pending.
Hosts with no ready renderer provision shells, setup, and default tabs through the existing host terminal provisioning path in the background. This covers headless hosts and attached renderers that crash or reload, with availability checked after creation finishes. Git worktrees, folder workspaces, and SSH creation paths are covered.
Why
The defect was an authority mistake: CLI/host activation was treated as a command to every subscriber. Earlier isolation checks covered paired UI callers but deliberately retained host/CLI broadcasts. The renderer then used normal activation and sidebar reveal, producing both symptoms. Fixing the producer defaults and validating intent at the receiving client addresses mixed versions and other creation entry points; suppressing sidebar scrolling alone would still switch the workspace.
Linked Issue
Direct maintainer report; no pre-existing issue linked.
Visual Proof
Reported defect: a remotely created workspace became selected in the reporting client's sidebar.
The following two captures are the same automated scenario with the fix, before and after a remote create. They are not screenshots of two different builds. A hidden host and a separately paired Electron desktop use real IPC, WebSocket RPC, Git, and rendered UI. The client starts in “My local work”; an older CLI-shaped remote create requests activation. The remote row appears, while the local workspace and sidebar position stay selected. A subsequent deliberate click opens the remote workspace.
Before the remote operation:
After the remote operation:
Testing
ORCA_BACKGROUND_LAUNCH=1.The renderer regression failed before its intent guard was added: an unaddressed legacy activation called the navigation handler. It passes with the guard. Initial focused suites passed 1,417 tests, one skipped, across 11 files. After the review fixes, four renderer suites passed 18 tests and an expanded runtime/CLI/RPC/Explorer selection passed 1,439 tests, one skipped, across 10 files. Coverage includes real two-client WebSocket isolation, reconnects, explicit broadcasts, legacy CLI arguments, host/headless execution, folders, mocked SSH provisioning, renderer crashes/reloads, and cancellation during both asynchronous discovery stages.
pnpm tc,pnpm run check:code-quality:changed, andgit diff --checkpassed. The E2E-mode app build andpaired-worktree-activation-isolation.spec.tspassed (one test). Linux, Windows, and live SSH were not exercised locally.To repeat the UI check:
Review
Three adversarial self-review passes and two automated review follow-ups completed:
Traced host/CLI/paired navigation authority, legacy requests, explicit broadcasts, and local/folder/SSH headless provisioning.
Found that an accepted activation could survive bridge disposal or connection replacement while awaiting discovery. Added regressions for disposal during repository discovery and connection replacement during worktree discovery; both failed before the fix. Extended existing generation/revision checks through both awaits and added a same-ID re-pairing regression.
Reviewed the follow-up diff, cleanup and re-pairing behavior, host identity collisions, mixed versions, and test oracles; repeated the relevant tests and rebuilt the hidden Electron scenario. No remaining actionable findings.
CodeRabbit identified a retained-notifier gap during renderer crashes/reloads. Four Git/folder regressions failed before the availability fix and now pass. All creation paths share the renderer-readiness decision and evaluate it after their creation awaits; SSH coverage includes losing the renderer during the remote request. Corrected a stale CLI comment and the CI RPC assertion that still expected default broadcast navigation.
The automated follow-up found that explicit
allrequests also need host background provisioning. Four Git/folder regressions reproduced the omission; reusing the existing host-target predicate makes them pass. After integrating current main, the final focused selection passed 1,399 tests, one skipped, across 11 files; typechecking and changed-code gates passed again. The rebuilt hidden paired-desktop E2E passed again (one test). Main independently corrected the unrelated Explorer assertion, so that file is absent from this PR. The automated final-commit follow-up reported no actionable comments.No independent human reviewer approval is claimed. Final-commit CI completed successfully: 22 checks passed, 21 intentionally skipped. PR Checks passed on attempt 2 after retrying a
setup-nodeevent-file parse failure and a runner shutdown; neither required a code change. Both actionable review threads are resolved, and the final automated review reported no actionable comments.Agent skill upstream boundary
Notes
The wire field is optional JSON, with no new stream opcode. Older clients understand explicitly published activation; updated hosts stop publishing implicit navigation to them. Against an older host, an updated client also ignores legacy explicit activation because that host cannot distinguish it from an implicit broadcast; opening the row manually still works. Mobile creation retains host-renderer provisioning. No new platform-specific process, path, or keyboard behavior, and no additional polling.
Checklist