Skip to content

test(wsl-mover): e2e for move + 3 reloads + undo; moved panes' first view carries their whole history (restore redesign 3/3) - #32969

Closed
nwparker wants to merge 3 commits into
nwparker/wsl-mover-restore-hold-reloadfrom
nwparker/wsl-mover-restore-e2e-undo
Closed

nwparker wants to merge 3 commits into
nwparker/wsl-mover-restore-hold-reloadfrom
nwparker/wsl-mover-restore-e2e-undo

Conversation

@nwparker

@nwparker nwparker commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​474 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​468
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​38

ELI5

This PR proves the new restore works end to end, and fixes the one gap the test found: the first time the desktop showed a moved terminal, it showed only the last ~1,000 lines of its history.

What Changed

  • New e2e (tests/e2e/wsl-move-restore-lifecycle.spec.ts):
    • Move, then reload:
      • A paired, windowless host stands in for the distro's server.
      • A real host terminal prints 2,000 lines and is put to sleep.
      • The move's real export reads that checkpoint, and the host's real installer lays it into the host's daemon.
      • The desktop then opens the pane 4 times: first open plus 3 reloads.
      • Each time, every line shows exactly once.
      • The restored shell is in the pane's folder (deep/), and the browser tab and the pre-move draft are there.
    • Undo:
      • A local pane printed 2,000 lines and was slept by the move's pause.
      • "Use on this computer again" reloads the window, and the pane comes back with its history once.
      • Typed input runs, so the pane is live.
  • Fix (for moved panes only):
    • Before: every remote subscribe snapshot carried at most 1,000 rows, so a 2,000-line moved pane first appeared cut in half.
    • After: for a pane whose session is a moved one (<worktree>@@moved-<key>), the snapshot tries 5,000 rows, then 2,000, then the usual ladder, within the same 512 KiB budget.
    • SSH, mobile and other panes keep 1,000.

Why

The e2e showed that the checkpoint replay itself is correct (no duplicates across reloads), but the shared subscribe cap cut the first view. Raising the cap only for moved panes keeps the shared remote limit unchanged. Undo needed no further code: slice 1 stopped routing moved panes' history through scrollback refs, so the move never removes the local history folders, and slice 2 put undo on the same hold-and-reload path.

Linked Issue

Stacked on #32965 (2/3), which is stacked on #32956 (1/3).

Visual Proof

N/A: behavior change only. Evidence is the e2e output: launch 0..3: first=1 last=1 (before the fix: first=0 on the first two launches), and undo: first=1 last=1.

Testing

  • Automated tests added/updated: the e2e above (2/2 pass locally on macOS) and unit tests for the row ladder and moved-session detection.
  • Manual: the real Windows/WSL move is still to come (verify-7). Agent resume is not in the portable e2e; it needs the WSL stub agent and is covered by the awin run.

Review

Self-reviewed (the author can't spawn a separate reviewer).

Agent skill upstream boundary

  • Not applicable.

Notes

Gated behind the internal WSL hosts gate. The larger row count applies only to moved-pane session ids.

@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from 98e3702 to ce77bdd Compare October 24, 2026 01:02
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 94e8c74 to 747e314 Compare October 24, 2026 01:03
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from ce77bdd to 4083c81 Compare October 24, 2026 02:29
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 747e314 to 755de79 Compare October 24, 2026 02:29
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from 4083c81 to 9c76368 Compare October 24, 2026 02:36
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 755de79 to e545d10 Compare October 24, 2026 02:36
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from 9c76368 to f89d4cb Compare October 24, 2026 02:47
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from e545d10 to 6891add Compare October 24, 2026 02:48
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from f89d4cb to 45c58fe Compare October 24, 2026 03:17
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 6891add to efc9b09 Compare October 24, 2026 03:17
@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch 3 times, most recently from ad091bc to b1e5b73 Compare October 25, 2026 00:20
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from 247dfe8 to 0797306 Compare October 25, 2026 01:47
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from b1e5b73 to 5b6cd87 Compare October 25, 2026 01:47
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from 0797306 to c67e00c Compare October 25, 2026 02:21
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch 2 times, most recently from 391f26d to 304cde7 Compare October 25, 2026 06:31
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch 2 times, most recently from 46bc798 to ca0cf9b Compare October 25, 2026 08:24
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 304cde7 to af2b211 Compare October 25, 2026 08:24
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from ca0cf9b to e37bcce Compare October 25, 2026 10:17
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from af2b211 to 11f826c Compare October 25, 2026 10:17
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-hold-reload branch from e37bcce to e8d20f8 Compare October 25, 2026 11:07
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 11f826c to 23add1b Compare October 25, 2026 11:07
nwparker and others added 3 commits October 25, 2026 05:11
…ed history

The host replays a moved pane's checkpoint once, but every remote subscribe snapshot carried at
most 1000 rows, so the desktop's first view of a 2,000-line pane lost its first half. Only for
panes whose session is a moved one, the subscribe snapshot now tries 5000 rows first, then 2000,
then the usual ladder, within the same byte budget.

Co-Authored-By: Claude <[email protected]>
…ead of sleeping

Main's flaky-test ratchet flags it: it now waits until the host terminal shows the printer's
last line before the pane sleeps, and each longer timeout says why.

Co-Authored-By: Claude <[email protected]>
@nwparker

Copy link
Copy Markdown
Contributor Author

Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept.

@nwparker nwparker closed this Oct 26, 2026
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.

1 participant