You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(e2e): check same-path editor models across two real hosts - #39208
A nightly test checks that when the same file path is open on two different machines, each copy keeps its own text and its own Undo history. The test faked the second machine. Since late October, Orca refuses to read a file from a machine other than the one the tab belongs to, so the fake tab showed an error and the test failed every night. The test now uses a real second machine.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$141
$\color{#cf222e}{\Huge{\mathbf{−}}}$92
$\color{#1a7f37}{\Huge{\mathbf{+}}}$49
Prod
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$13
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$13
What Changed
tests/e2e/editor-model-host-isolation.spec.ts is rewritten:
Before: one Orca window opened the same local file twice. It labelled the second tab as belonging to an SSH host (ssh:fixture-target) that doesn't exist, then relied on the file read quietly falling back to the local disk. Since Support automations in Orca Mobile #31617, the file loader reads only from the host the tab belongs to. That host can't be verified, so the tab showed "Unable to load file. Couldn't verify which host owns this file." and the editor never mounted.
After: the spec launches a second Orca app that pairs with the test host as a remote runtime, the same way the other paired-* specs do. That client adds the same checkout as a local project too, so one window has the same file path open on two real hosts. The test then:
types ! in the local copy
checks the remote copy still shows the original text
checks Undo in the remote copy doesn't remove the local !
types ? in the remote copy and undoes it
checks the local copy still shows !
It reads each host's editor by its model address: file: for local, and a host-specific vscode-remote: address for the runtime. So it also checks that the remote copy gets its own model instead of sharing the local one. Each project keeps its own editor mounted, so the old single global probe (__monacoEditorE2E) could point at whichever editor mounted last.
New PR routing rule editor.host-model-identity: changes to the editor model identity code, the editor file loader, or editor file ownership now run this spec. Before, no source change selected it. Covered in pr-e2e-gate-contract.test.mjs.
Why
The product behavior is correct. A tab that belongs to one host must never quietly read another host's disk. The test was depending on that leak. I considered keeping the fake tab and loosening the owner check for it, but that means changing product code to make a test pass. A paired runtime is the cheapest real second host CI already runs (no Docker or SSH needed), and on one machine both hosts see the same path. That is exactly the collision this feature guards against.
Linked Issue
N/A (nightly E2E failure, maintainer)
Visual Proof
N/A. Test-only change; the app behaves the same.
Testing
Old spec on current main: fails locally the same way it does in CI (Received: undefined, screenshot shows the owner-verification error).
New spec: ORCA_BACKGROUND_LAUNCH=1 pnpm run test:e2e tests/e2e/editor-model-host-isolation.spec.ts --repeat-each=3 passed 3/3 on macOS. If the two hosts shared one model, the vscode-remote: editor would never appear, and the remote copy would show MARKER!.
pnpm test config/scripts/workflow/source-routing/, pnpm tc, pnpm run check:code-quality:changed pass.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
Low. Test and CI routing only. The spec now starts a second Electron app, which adds roughly 20 seconds. Undo with a plain revert.
Level: Low
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.
Checklist
This PR is small and focused
I explained what changed and why
I stated the risk
N/A with reason for visuals
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered
The E2E test now opens the same file through local and runtime worktrees, then checks that edits and undo operations remain isolated between the two editor models. A new source route selects this test for specified editor product-source changes, and routing tests check the included source paths and an excluded unit-test path.
Merge Risk: Low · up to 85db1
This change only adds and reroutes an E2E test and does not alter product behavior. The test may be flaky on Windows because of path comparison. The route entry for the owner file is also not covered by a test. It is mergeable, with these items worth fixing.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly describes the main E2E test change.
Description check
The description is mostly complete. Add the Review and Notes sections, clarify lint and build status, and correct the routing test filename if needed.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.
Finishing Touches
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The spec forged an SSH owner for a local file and relied on the read
falling back to local transport. Since #31617 a tab reads only from its
captured owner, so the forged tab correctly shows 'Couldn't verify which
host owns this file'. Use a paired client that opens the same checkout
locally and on its runtime host instead, and route editor model identity
sources to the spec.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
On Windows, Git can report the checkout with forward slashes while testRepoPath uses backslashes. The strict comparison can then time out even when the runtime has the worktree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
A nightly test checks that when the same file path is open on two different machines, each copy keeps its own text and its own Undo history. The test faked the second machine. Since late October, Orca refuses to read a file from a machine other than the one the tab belongs to, so the fake tab showed an error and the test failed every night. The test now uses a real second machine.
What Changed
tests/e2e/editor-model-host-isolation.spec.tsis rewritten:ssh:fixture-target) that doesn't exist, then relied on the file read quietly falling back to the local disk. Since Support automations in Orca Mobile #31617, the file loader reads only from the host the tab belongs to. That host can't be verified, so the tab showed "Unable to load file. Couldn't verify which host owns this file." and the editor never mounted.paired-*specs do. That client adds the same checkout as a local project too, so one window has the same file path open on two real hosts. The test then:!in the local copy!?in the remote copy and undoes it!file:for local, and a host-specificvscode-remote:address for the runtime. So it also checks that the remote copy gets its own model instead of sharing the local one. Each project keeps its own editor mounted, so the old single global probe (__monacoEditorE2E) could point at whichever editor mounted last.editor.host-model-identity: changes to the editor model identity code, the editor file loader, or editor file ownership now run this spec. Before, no source change selected it. Covered inpr-e2e-gate-contract.test.mjs.Why
The product behavior is correct. A tab that belongs to one host must never quietly read another host's disk. The test was depending on that leak. I considered keeping the fake tab and loosening the owner check for it, but that means changing product code to make a test pass. A paired runtime is the cheapest real second host CI already runs (no Docker or SSH needed), and on one machine both hosts see the same path. That is exactly the collision this feature guards against.
Linked Issue
N/A (nightly E2E failure, maintainer)
Visual Proof
N/A. Test-only change; the app behaves the same.
Testing
Old spec on current main: fails locally the same way it does in CI (
Received: undefined, screenshot shows the owner-verification error).New spec:
ORCA_BACKGROUND_LAUNCH=1 pnpm run test:e2e tests/e2e/editor-model-host-isolation.spec.ts --repeat-each=3passed 3/3 on macOS. If the two hosts shared one model, thevscode-remote:editor would never appear, and the remote copy would showMARKER!.pnpm test config/scripts/workflow/source-routing/,pnpm tc,pnpm run check:code-quality:changedpass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
Low. Test and CI routing only. The spec now starts a second Electron app, which adds roughly 20 seconds. Undo with a plain revert.
Level: Low
Agent skill upstream boundary
Checklist
N/Awith reason for visuals