Repository navigation
Conversation
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:
e89e1652-6122-481f-8105-279a4d97d649
📥 Commits
Reviewing files that changed from the base of the PR and between 5cf3585 and 3bc7c849f7a275aa167b518f1912fc293069ce0d.
📒 Files selected for processing (21)
config/scripts/pr-code-change-scope-cross-version-editor-mirror.test.mjsconfig/scripts/pr-code-change-scope.mjssrc/renderer/src/lib/workspace-session.tssrc/renderer/src/runtime/sync-runtime-graph-projection-hot-path.test.tssrc/renderer/src/runtime/sync-runtime-graph/mirrored-editor-tab-persistence.test.tssrc/renderer/src/runtime/sync-runtime-graph/mirrored-editor-tab-republication.test.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-surfaces.tssrc/renderer/src/runtime/sync-runtime-graph/sync-projections.tssrc/renderer/src/store/slices/editor/actions/hydrate-editor-session.tssrc/shared/workspace-session-editor-schema.tssrc/shared/workspace-session-schema-field-coverage.test.tssrc/shared/workspace-session-state-types.tstests/e2e/cross-version-wire/cross-version-session-tabs-editor-mirror.unit.test.tstests/e2e/helpers/editor-mirror-peer-setup.tstests/e2e/helpers/editor-mirror-persisted-partitions.tstests/e2e/helpers/editor-mirror-renderer-store.tstests/e2e/helpers/editor-mirror-session-inventory.tstests/e2e/helpers/editor-mirror-soak.tstests/e2e/helpers/localhost-ssh-target-preflight.tstests/e2e/paired-editor-mirror-echo-reciprocal.spec.tstests/e2e/paired-editor-mirror-echo-restart-ssh.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
… peer echoes it Main now retains a local editor row and tab when a peer frame claims the same id, so the old-peer echo characterization no longer expects the local row to be duplicated or its tab dropped.
… an owned mirror id
…h a host pin Since stablyai#26593 the mirror resolver reuses an existing row for the same owner, so a row restored from the profile keeps its owned editor: id when the host's snapshot lands; the bare-path id the spec waited for can no longer appear. The host now pins its tab after the relaunch and the client must show the pin on the tab backed by its restored row. The ids-seen list is reported at failure time instead of being captured empty before polling.
e0dc7f5 to
d5c6c1f
Compare
…fter barrel removal
…-session under max-lines
|
Hit this on 1.4.237 with a Mac and a Windows desktop paired both ways. In my One gap I think this leaves: a peer still on an older build keeps republishing, and saved layouts that already carry the variants keep sending them. I opened #31984 to collapse those on the receiving side. It doesn't touch anything this PR changes, so either can land first. |
…epublishes mirrors Main's stablyai#31984 fixture published a mirrored row, which this branch no longer republishes.
|
Maintainer refresh: merged current main (2a20d2d) into this branch, no textual conflicts. After the merge, main's #31984 test |
…e-scope under its line budget
|
Follow-up (a4f83a0): the refreshed head failed the oxlint max-lines gate, because |
…de-change-scope under its line budget" This reverts commit a4f83a0.
|
I reverted the split (bee99f9). PR Checks sparse-checks out Still blocking: after merging current main,
Maintainer decision needed. The production fix and the test-fixture update (d622f77) are unaffected. |
…33259) * fix(runtime): stop paired desktops republishing mirrored editor tabs When two desktops pair both ways, B mirrored A's editor tabs and then published them in its own session inventory as if B had opened them. A then applied B's copy, which took over A's own tab. isMobilePublishableOpenFile now skips rows marked mirroredFromRuntimeSession, the marker is part of the open-files sync projection so a flip republishes, and the marker is saved with the session and restored so a relaunched client does not republish its restored mirrors before the host's first snapshot. Based on #25877 by BearMett. Co-authored-by: BearMett <[email protected]> * fix(runtime): keep restored mirrors through unpublished frames and out of headless publication A restored mirror now carries its marker, so an unpublished host frame must not cull it (and its recovered draft). The windowless publication skips persisted mirrored rows for the same reason the window does. Co-authored-by: BearMett <[email protected]> --------- Co-authored-by: BearMett <[email protected]>
|
Thank you @BearMett, and sorry this sat open for so long. Your diagnosis was right. When two desktops pair both ways, each one republished the editor tabs it was only mirroring, and the host then took them back as if the peer had opened them. We reproduced it on current main using your reciprocal two-desktop spec. Desktop B listed A's We've landed the fix in #33259, with you as co-author, and we're closing this PR in favour of it. From your work we kept:
We also added two follow-ups your change exposed:
We didn't check in the e2e specs and helpers, the cross-version release-checkout suite or the CI routing change. They were very valuable for verifying the fix. They're long and soak-heavy to keep in CI, though, and the unit tests catch the same regression deterministically. Thanks again for such a careful, well-evidenced write-up. |
|
Thanks, @nwparker, and no worries about the wait. Glad the reciprocal and restart specs reproduced it on current main, and the two follow-ups cover the remaining gaps. The cross-version release-checkout suite really helped me confirm the bug across versions, but I'd already been concerned that it would be too heavy to use directly in CI. So I fully agree with keeping the unit tests in CI and leaving that suite out. Appreciate the co-author credit. |
ELI5
When two Orca desktops are paired with each other, each one shows the other's open editor tabs. Before this change, a desktop also told its peer about the tabs it was only showing for that peer. Mirrored tabs were republished, which could echo tabs back to their originating host, and a closed tab could come back because the peer sent it again. Now a desktop only announces the tabs it actually opened itself.
What Changed
Before: desktops A and B are paired in both directions. A file opened on A shows up on B as a mirrored tab. B announces it to A as one of B's own tabs, and A can show it again. The same file can appear as more than one tab, and a closed tab can come back when a peer reconnects.
After: B shows A's tab but never announces it. Each updated host publishes only the tabs it owns, so between two updated peers a close holds for rows that carry the mirror marker.
How it works (10 production lines in 7 files):
isMobilePublishableOpenFileskips rows withmirroredFromRuntimeSession === true. That flag already marked tabs received from another host, but publishing ignored it. The flag is also added to the open-files sync projection, so changing it re-runs publishing.workspace-layout-disk-fields.ts), and copied back when the session loads. Without this, a restored mirror came back unmarked and was republished after every relaunch.tabs: []) instead of disappearing. Worktrees holding only mirrored terminals already behave this way.config/scripts/pr-code-change-scope.mjsnow runs the cross-version CI job when the publishing, mirror-apply, editor-schema or salvage modules change.Rebase notes:
isMobilePublishableOpenFilecheck (Open a chat visual in its own tab instead of the sidebar #26728). Both exclusions are kept.mirrored-editor-tab-republication.test.ts("keeps the local owner and tab when an old peer echoes the same path") now expects that: the host's tab stays, and the echoed row gets its own owned id.pnpm run build:relay) and relay-routed SSH. Main removed relay-only wiring and the relay build from e2e setup (ci(e2e): one managed-SSH lane and routing regex; no relay build in e2e setup #27640, refactor(providers): delete the SSH git and filesystem providers and relay-only wiring #27644, refactor(ssh): delete relay-only GC, takeover and install remnants #27770), so that test cannot run as written. The SSH unit coverage is unchanged; live SSH is not verified.editor:id of a mirrored row restored from its profile when the host's snapshot arrives. The spec used to wait for an id switch, so it now waits for a host-only change instead: the host pins its tab after the client relaunches, and the client must show that pin. The checks after that point are unchanged.Why
The host already knows exactly which rows it received from a peer, so filtering on that marker is precise. Two alternatives were rejected:
runtimeEnvironmentId. That id is also set on files a host really owns (SSH-owned files, and files opened through the focused-environment path). This approach would hide legitimate tabs.No capability gate is needed: receivers already treat a missing tab as closed, and no field, frame or opcode is added on the wire.
Linked Issue
Fixes #27984
Related to #21121, which absorbed the closed report #17778. Field evidence: this measurement on #23967 shows this loop. Not fixed here: older peers echoing under the host's own tab id (see Notes).
Visual Proof
Nothing new is drawn on screen; the difference is which tabs a paired desktop publishes. From
mirrored-editor-tab-republication.test.tsandmirrored-editor-tab-persistence.test.ts: host A has/repo/app.tsopen as tabhost-file-tab, and peer B applies A's snapshot.Before (main, pinned by the characterization test in
c2bb84ddf7), B's published snapshot for that worktree:After, both right after the snapshot and after B saves, reloads, and applies A's snapshot again:
Hidden Electron checks on the refreshed head verify reciprocal pairing, final close, and real restart. CDP screenshots and hidden native-window receipts are preserved in the audit evidence. Attachment upload is unavailable in this environment without a browser session token.
Testing
Current head
39ce049d5b69merges main816fcee74214while preserving the contributor implementation. This includes the already-merged fixes for the old calendar-dependent scanner and socket-backpressure CI fixtures. One cross-version fixture now initializeseditorBuffers: {}to match the current sync state; there are no new production changes in this refresh.Local validation used macOS. Linux/Windows and live SSH acceptance remain for CI or follow-up. The supplemental broad E2E tooling typecheck has 252 diagnostics, including missing separately installed cloud dependencies and other test errors; none name the 22 PR paths. No full baseline comparison or global E2E typecheck success is claimed.
Fresh CI is required for this head; the old
40ba2eddrun does not validate the refresh. Main advanced by an unrelated watcher change after the pinned merge, with no changes in the 22 PR paths.AI Disclosure
Written with Codex (gpt-6-astra) and Claude Code (Claude Opus 5.5).
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
v1.4.204builder source), so its echo carries the host's own tab id. In that case the host keeps its own file record, but its own tab is moved into the peer-sync group, stamped as owned by the older peer, and still published; it stays that way after the older peer closes the mirror. The cross-version test case 3 pins this.runtimeEnvironmentIdalone cannot tell them apart from local files, so they are still republished after a restart. Nothing in this PR re-marks them.mirroredFromRuntimeSession: true, and the schema accepts onlytrue. A hand-writtenfalserow is dropped by the salvage path (case 5).Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Typecheck, changed-code quality and the related suites pass locally. Full lint, the full test suite and the build are left to CI.