Repository navigation
Conversation
Moving a split pane to a new tab in a paired-runtime worktree changed only the window store. The host never learned about the move, so the next host snapshot rebuilt the old tab and the pane snapped back. Add a session.tabs.movePaneToNewTab RPC that commits the move in the host session through planTerminalLeafMove and republishes the session tabs. For a mirrored host tab, the renderer applies the move first under the mirrored id the host snapshot will use, then asks the host to commit it. An older host or a refused move falls back to the old local-only move. Fixes stablyai#32939
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
… writer The layout-writer ratchet allows no new main-process layout writers. The headless host now hands the move to commitLeafMoveAndRekey, the same commit a local window uses, and keeps only the window check, validation, rehydrate and notify.
|
Thank you, @bengry, for the clear report in #32939 and for this PR. Your diagnosis was right: the move has to be committed on the host, through the existing leaf-move writer. We've shipped it in #33027 with both of your commits kept as they were. On top, we added a capability gate for older hosts, host-side placement of the new tab (keeping the order of the other tabs), the live terminal record following the pane, and an undo when the host refuses or the reply is lost, plus a paired e2e. We're closing this PR in favour of #33027. Thanks again! |
ELI5
When you drag a pane out of a split into its own tab on a remote Orca server, only your window learned about the move. The server still had the old layout and kept sending it back, so the pane jumped back into the split. Now your window tells the server, and the server saves the move.
What Changed
moveLeafToNewTabreturnsnot_held(web-terminal-api.ts), and shipped hosts registerlayout.applyonly in layout-owner builds. The next host snapshot rebuilt the old tab fromparentTabIdand the pane snapped back.planTerminalLeafMove, then republishes the session tabs.commitLeafMoveAndRekey, the leaf move a local window already uses, so no new main-process layout writer is added (layout-writer ratchet).Why
The host is authoritative for which leaf belongs to which tab, so the move has to be committed there. The host already has a durable leaf move (
planTerminalLeafMove). This PR adds the missing RPC to reach it from a paired client.layout.apply movePaneToNewTabwould cover this once layout-owner builds ship. Until then, shipped hosts have no RPC that can change leaf membership (session.tabs.updatePaneLayoutchanges geometry only).Linked Issue
Fixes #32939
Visual Proof
No recording attached. Evidence from an end-to-end run:
a real pointer drag in a paired Electron desktop client
against a headless Electron
--servehoston Linux with Xvfb
Before (
main):final client: web-terminal-10bbe5fe{d95aa7c7, 50198b0b}. The dragged leaf is back in the source tab. The host never moved it.After (this branch): samples at +0, +50, +100, +250, +500 and +1000 ms all show
{"web-terminal-a179ce76":["744c394c"],"web-terminal-16d9f559":["e5bf9d19"]}.leafConnects=1 freshSpawns=0: one reattach, no remount.Testing
orcadbuilt from this branch, paired with the browser client served byorcad --web-client-root.headless-move-leaf-to-new-tab.test.ts: the realplanTerminalLeafMoveon a headless session with 2 leaves. Checks the persisted layouts andparentTabIdinlistMobileSessionTabs, and that an invalid id is refused with the session unchanged.session-tabs-move-pane-to-new-tab.test.ts: RPC dispatch.terminal-pane-tab-detach-runtime-host.test.ts: the local move happens before the host answers, with the mirrored id and opt-in. On refusal,applyMoveruns exactly once.web-runtime-leaf-move.test.ts: host ids, and an old host or RPC error mapped tonot_held.terminal-tab-mirrored-id.test.ts: real store. An opted-in mirrored id is kept, a duplicate throws, and the id is rejected without the opt-in.orcad: 19 of 19 checks pass on the branch. Onmainthe method is unknown.pnpm typecheckpasses. oxlint and oxfmt pass on changed files. vitest passes on the related suites (store/terminals, web-runtime, terminal-pane-tab-detach, rpc session-tab, web-session-tabs-sync, main/runtime/headless, shared/terminal): 1547 tests.pnpm lintor the wholepnpm test.AI Disclosure
Written with Claude Code: Claude Opus 5.5 orchestrating, with Sonnet and Opus subagents for code tracing, implementation, review and the e2e repro. I reviewed the diff and ran the manual test.
Review
Door: two-way. Additive RPC plus a client path that falls back to today's behaviour. Revert is clean, and no persisted format changes.
Blast radius: paired-runtime pane moves.
not_heldand the bug remains there.Agent skill upstream boundary
Notes
workspacepermission and checks that the source tab is visible to the client. The host validates the request shape before any write. It refuses an existing target id and a leaf held by another tab.Checklist
N/Awith reason (e2e log evidence above; no recording)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpasspnpm testfails here. It also fails onmain.pnpm lint,pnpm typecheckandpnpm buildpass on this branch.pnpm testfails on this branch with 68 files / 101 tests. The same 68 files and 101 tests fail on its base18555204frommain, run the same way. This branch adds no new failures.tests/e2e/cross-version-wire/*: needs release tags (v1.4.190) that a shallow clone does not have.config/scriptsgit-ref tests.