Skip to content

Keep managed workspace paths out of desktop editor launches - #26668

Merged
OrcaWin merged 3 commits into
mainfrom
nwparker/remote-open-in-owner
Oct 9, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
nwparker/remote-open-in-owner

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​342 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​334
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​112 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​84

ELI5

A remote file and a desktop file can have the same address. Orca offered a desktop editor for the remote file and opened the desktop copy instead. The menus now check which machine owns the target before offering or dispatching a local application.

What Changed

Pass the existing workspace-owner answer through Source Control, the Files toolbar, and worktree/folder context menus into their shared Open in capability and click guards. Managed targets show the existing “Local only” hint and cannot send their path to a desktop editor or file manager while the global runtime focus is local.

Why

Managed conversion removes the old SSH connection ID from the repository. Checking that ID and global focus therefore misses host-owned targets. Extending the shared guards keeps menu state and click handling consistent, preserves local launchers and existing legacy SSH VS Code support, and avoids separate rules for each menu.

Linked Issue

Found while exercising SSH-to-managed-server conversion on Phase 3.5. No existing issue linked.

Visual Proof

Source Control before / after:

remote-open-in-source-control-editor-owner-before.png
remote-open-in-source-control-editor-owner-after.png

Non-Git folder before / after (after also proves the inactive-row case):

remote-open-in-folder-menu-editor-owner-before.png
remote-open-in-folder-menu-editor-owner-after.png

remote-menu-editor-owner-phase35-runtime-red.log
remote-open-in-owner-final-runtime-green.log
remote-open-in-owner-runtime-green.log
remote-menu-editor-owner-unit-red.log
remote-open-in-inactive-row-unit-red.log

The baseline used an owned recorder executable in place of a real editor: a legitimate local control launched it, then each remote menu launched it on the desktop and read LOCAL_ONLY_EDITOR_COLLISION. Positive host RPC returned REMOTE_ONLY_EDITOR_OWNER for the same absolute path. No native window was opened or focused.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

126 affected unit/component/CI-contract tests across 13 files pass. Full pnpm tc, pnpm lint, changed-code/design-system checks and a fresh Electron E2E build pass. All four new real SSH regressions fail on unchanged Phase 3.5. The corrected 11-case conversion/update/stdio/port/idle/restart suite passes in 3.0 minutes. Final rebuilt menu cases pass in 43.5 seconds, including inactive worktree and folder rows (10.4 / 9.6 / 11.4 / 10.5 seconds). A further inactive-row component regression failed before honoring the row’s explicit host and passes after the correction.

Tests cover a Git file, Git root and non-Git folder on disposable Linux Docker SSH hosts with a hidden macOS Electron renderer. Local and legacy SSH launcher controls are covered. Native Windows runtime was not exercised.

CI routes changed guards/menus and the shared harness to the Docker lane that builds the server template; the general lane excludes this dedicated spec. The reachability contract now also inspects workflow steps that actually enable Docker.

Review

P1 / Medium merge risk. Affects shared desktop-opening guards and owner propagation across four menus; preserves IPC and remote wire formats. Independent base: OrcaWin/phase35, c8f0a25, with no dependency on the previously handed-off PRs.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Uses existing owner resolution, platform-neutral capability policy, menu hints and localization. No new effects, network calls, host writes in product code, or provider-specific logic. Folder workspaces are exercised through their real menu. No native editor or file-manager focus test was run.

Initial CI had two audited failures. The unchanged telemetry privacy test matched 2222 inside random trace ID eb2592222be5240b0b49b5e10e3f068e; the span attributes contain no pane or PTY IDs. Node shard 10/10 passed 12,952 tests and skipped 86. The Docker lane passed ten cases and failed the worktree-menu fixture before the menu because it unnecessarily queried the asynchronously hydrated folder catalog once. One failed-job retry was requested; both original receipts are retained.

Commit 88db24baeb7 now queries the folder catalog only in the folder case and waits for its actual hydration. All menu/recorder assertions are preserved. A fresh exact build passes all four menu cases in 42.1 seconds. Corrected fixture runtime log. Updated head 88db24b has fully green CI: 22 successful checks / 22 conditional skips, including the corrected Docker lane and verify.

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)

@OrcaWin

OrcaWin commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Rebased onto main (Phase 3.5 has merged) and retargeted the base to main. Changes on top: resolved conflicts with the browser/editor-ownership specs now in the same managed Docker lane; dropped the duplicate Docker reachability test file because main already has the same check in pr-e2e-docker-lane-contract.test.mjs; moved the sidebar row's owner lookup into a small WorktreeRowOpenInSubMenu so it runs only while the menu is open instead of on every store update for every row; isRevealInFileManagerBlocked now reuses the extended guard. The new guard unit tests fail on main and pass here; tc, affected tests, oxlint, the changed-code gate and anti-slop pass.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 96fa3d53-020d-44d7-bc06-268584281713
📥 Commits

Reviewing files that changed from the base of the PR and between bc0c6f26c7a76671e982e1b794c96b031968af56 and 9a3416a.

📒 Files selected for processing (4)
  • .github/workflows/e2e.yml
  • config/scripts/ci-e2e-job-selection.mjs
  • config/scripts/orcad-e2e-routing.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs

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


📝 Walkthrough

Walkthrough

Open-in checks now receive the target runtime environment ID and block file-manager or external-editor actions for managed owners. Worktree menus and the file explorer pass this ID through the relevant checks. A Docker-backed E2E spec exercises four UI surfaces. CI selection and routing include the spec in the dedicated Docker job.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 9a341

The change is mergeable with owner awareness, but future changes to two Open in entry points may miss the dedicated regression test. Add those paths to the route and its test.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check Warning The description explains the change, motivation, testing, visual behavior, risks, and checklist status. However, the required Linked Issue section states that no existing issue is linked, which does n… Add a link to the issue addressed by this pull request in the Linked Issue section, using the required Fixes # format or an equivalent issue reference.
Docstring Coverage Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 19 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: preventing managed workspace paths from being opened by desktop editors.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, motivation, testing, visual behavior, risks, and checklist status. However, the required Linked Issue section states that no existing issue is linked, which does not meet the repository template requirement.

Full details: Docstring Coverage

Explanation

Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 19 files. (1 skipped: 1 unsupported.)

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

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.

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

🧹 Nitpick comments (1)
config/scripts/pr-e2e-source-routing.mjs (1)

93-93: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Route both managed-owner implementations to the owner E2E spec.

The source route uses exact path matching. A PR that changes only WorktreeRowOpenInSubMenu.tsx or reveal-in-file-manager.ts can therefore omit tests/e2e/ssh-orcad-open-in-owner.spec.ts. This is a test-coverage gap, not a desktop launch regression. Add both paths to the route and its routing assertion.

Suggested routing update
- /^src\/renderer\/src\/(?:lib\/(?:local-path-open-guard|external-editor-open-capability|worktree-runtime-owner)\.ts|components\/(?:sidebar\/(?:WorktreeOpenInMenu|WorktreeContextMenuView)\.tsx|right-sidebar\/(?:FileExplorer(?:Toolbar)?\.tsx|source-control\/listing\/entry-context-menu\.tsx)))$/.test(
+ /^src\/renderer\/src\/(?:lib\/(?:local-path-open-guard|external-editor-open-capability|worktree-runtime-owner|reveal-in-file-manager)\.ts|components\/(?:sidebar\/(?:WorktreeOpenInMenu|WorktreeContextMenuView|WorktreeRowOpenInSubMenu)\.tsx|right-sidebar\/(?:FileExplorer(?:Toolbar)?\.tsx|source-control\/listing\/entry-context-menu\.tsx)))$/.test(

Add the same two paths to the source list in config/scripts/orcad-e2e-routing.test.mjs.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9638993-17f8-4c71-add2-0b3612baa53d
📥 Commits

Reviewing files that changed from the base of the PR and between 4e232f9 and 486786c4e03518751ca7073b15fd20d17ba95de7.

📒 Files selected for processing (20)
  • .github/workflows/e2e.yml
  • config/scripts/ci-e2e-job-selection.mjs
  • config/scripts/orcad-e2e-routing.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • src/renderer/src/components/right-sidebar/FileExplorer.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerToolbar.test.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerToolbar.tsx
  • src/renderer/src/components/right-sidebar/source-control-entry-context-menu.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/listing/entry-context-menu.tsx
  • src/renderer/src/components/sidebar/WorktreeContextMenu.copy-worktree-name.test.tsx
  • src/renderer/src/components/sidebar/WorktreeContextMenuView.tsx
  • src/renderer/src/components/sidebar/WorktreeOpenInMenu.test.tsx
  • src/renderer/src/components/sidebar/WorktreeOpenInMenu.tsx
  • src/renderer/src/components/sidebar/WorktreeRowOpenInSubMenu.tsx
  • src/renderer/src/lib/external-editor-open-capability.test.ts
  • src/renderer/src/lib/external-editor-open-capability.ts
  • src/renderer/src/lib/local-path-open-guard.test.ts
  • src/renderer/src/lib/local-path-open-guard.ts
  • src/renderer/src/lib/reveal-in-file-manager.ts
  • tests/e2e/ssh-orcad-open-in-owner.spec.ts

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

@OrcaWin
OrcaWin force-pushed the nwparker/remote-open-in-owner branch from 486786c to bc0c6f2 Compare October 9, 2026 05:49

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 787a0349-6632-4fa0-b2b3-7f11168d76fe
📥 Commits

Reviewing files that changed from the base of the PR and between 486786c4e03518751ca7073b15fd20d17ba95de7 and bc0c6f26c7a76671e982e1b794c96b031968af56.

📒 Files selected for processing (3)
  • .github/workflows/e2e.yml
  • config/scripts/ci-e2e-job-selection.mjs
  • config/scripts/pr-e2e-source-routing.mjs

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

Comment on lines +101 to +103
(isProductSource(file) &&
/^src\/renderer\/src\/(?:lib\/(?:local-path-open-guard|external-editor-open-capability|worktree-runtime-owner)\.ts|components\/(?:sidebar\/(?:WorktreeOpenInMenu|WorktreeContextMenuView)\.tsx|right-sidebar\/(?:FileExplorer(?:Toolbar)?\.tsx|source-control\/listing\/entry-context-menu\.tsx)))$/.test(
file

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Route both remaining Open in entry points to the owner regression.

The source pattern omits src/renderer/src/components/sidebar/WorktreeRowOpenInSubMenu.tsx and src/renderer/src/lib/reveal-in-file-manager.ts. If a later PR changes only one of these files, this route will not select ssh-orcad-open-in-owner.spec.ts. Add both paths to the pattern and its routing test.

@OrcaWin

OrcaWin commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Rebased onto main (resolved e2e routing conflicts by keeping both the markdown-conversion and open-in-owner specs). Unit shard 4/5 failed in src/main/git/worktree-base-divergence-real-git.test.ts ('refuses unrelated histories', expected 'unknown' to be 'exceeded' after 2032ms) — a real-git timing test this PR doesn't touch; rerunning failed jobs once.

@OrcaWin
OrcaWin force-pushed the nwparker/remote-open-in-owner branch from bc0c6f2 to a70ab92 Compare October 9, 2026 06:25
@OrcaWin
OrcaWin force-pushed the nwparker/remote-open-in-owner branch from a70ab92 to 9a3416a Compare October 9, 2026 06:27
@OrcaWin
OrcaWin merged commit f01bd93 into main Oct 9, 2026
39 checks passed
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.

2 participants