Repository navigation
fix(runtime): stop paired desktops republishing mirrored editor tabs - #33259
Merged
Merged
Conversation
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]>
…t 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]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
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 |
5 of 7 tasks
8 of 9 tasks
9 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
When two Orca desktops pair with each other, each one shows the other's open editor tabs. Before this change, a desktop also announced the tabs it was only showing for its peer as if it had opened them itself. The original desktop took those back and treated its own tab as the peer's. Now a desktop only announces tabs it really opened.
Based on #25877 by BearMett. The core fix is theirs; they are credited as co-author on both commits.
What Changed
Before: desktops A and B are paired in both directions, and A opens
src/index.ts. B mirrors it, then lists it in B's own session inventory. A applies B's copy, and A's own tab ends up attributed to B (executionHostId: runtime:<B>).After: B still shows A's tab, but never lists it. A keeps its own tab, and closing it on A closes it on B with nothing coming back.
Mechanism:
isMobilePublishableOpenFileskips rows markedmirroredFromRuntimeSession. Received host tabs already carried that marker, but publishing ignored it. The marker is now part of the open-files sync projection, so a change to it republishes. (fix(runtime): stop paired hosts from echoing mirrored editor tabs #25877)publicationEpoch: 'none') no longer culls mirrored editor files. Once restored mirrors keep their marker, that frame would delete a restored dirty mirror and its hot-exit draft. This follows the existing rule inhost-session-snapshot-authority.ts: an unpublished frame proves nothing, so it must not drive a cull.buildHeadlessMobileSessionEditorTabs) skips persisted mirrored rows too. Without this, the echo would come back when no window is open.Why
The receiving desktop already marks exactly which rows came from a peer, so filtering on that marker is precise. Inferring "mirrored" from
runtimeEnvironmentIdwould hide files a host really owns, such as SSH-owned files or files opened through the focused-environment path.No wire field, frame or opcode is added. Receivers already treat a missing tab as closed, and a host that has only mirrored tabs already publishes
tabs: [].Mixed versions:
Linked Issue
Fixes #27984
Visual Proof
N/A. Nothing new is drawn on screen; the change is in which tabs a paired desktop publishes. Hidden-window e2e evidence is under Testing.
Testing
ceec67b8ec82) with the contributor's hidden reciprocal two-desktop spec, run withORCA_BACKGROUND_LAUNCH=1and isolated profiles:session.tabs.listAlllists A'ssrc/index.tsas B's own tab.runtime:<B>.paired-mobile-desktop-mirror.spec.ts(2 tests) andpaired-mobile-desktop-mirror-files-git-review.spec.ts.mirrored-editor-tab-republication.test.ts: no republish; a local file in the same worktree still publishes; the tabless fallback path; resync when only the marker changes.mirrored-editor-tab-persistence.test.ts: the marker survives save, load and hydrate, and is not republished. A restored dirty mirror survives an unpublished frame and is culled by a real empty one.mobile-session-editor-projection.test.ts: the headless projection skips mirrored rows.Not kept from #25877, for test-cost reasons:
pr-code-change-scoperouting change.They were run locally as verification.
Review
Codex (pinned base
ceec67b8ec82): round 1 found the unpublished-frame draft loss (P1), fixed in the second commit; round 2 is clean. An independent Opus review found the headless-publication gap (P2), now fixed; round 2 reports no P0–P2.Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)