Skip to content

test(wsl-mover): undo wakes the moved project's panes live, after reloads and a restart (restore redesign, undo) - #33040

Closed
nwparker wants to merge 21 commits into
nwparker/wsl-mover-restore-e2e-undofrom
nwparker/wsl-mover-restore-undo-live
Closed

nwparker wants to merge 21 commits into
nwparker/wsl-mover-restore-e2e-undofrom
nwparker/wsl-mover-restore-undo-live

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​822 $\color{#cf222e}{\Huge{\mathbf{−}}}$​58 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​764
Prod 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​489 $\color{#cf222e}{\Huge{\mathbf{−}}}$​35 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​454

ELI5

Undo ("Use on this computer again") used to bring a moved project back with blank terminals that took no input. This PR proves that, with the redesign below it, undo brings the project back the way waking a slept workspace does: each terminal shows its history once and takes input.

What Changed

Why

The ask was to fix undo and cover it in the e2e. The faithful e2e passes on the stack as it is, so this PR adds coverage rather than code. If the Windows/WSL run (verify-7) still shows blank panes, the gap is specific to WSL-bridged panes, and this test is where it gets reproduced.

Linked Issue

Stacked on #32969 (restore redesign 3/3).

Visual Proof

N/A: test only. e2e output: undo UNDOA: first=1 last=1, undo UNDOB: first=1 last=1, 2/2 passed.

Testing

  • Automated tests added/updated: tests/e2e/wsl-move-restore-lifecycle.spec.ts (2/2 pass locally on macOS).
  • Manual: the Windows/WSL run is verify-7.

Review

Self-reviewed.

Agent skill upstream boundary

  • Not applicable.

Notes

Test-only; gated feature.

@blacksmith-sh

This comment has been minimized.

@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from efc9b09 to 554460a Compare October 24, 2026 09:13
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch from 41fbd74 to 06ce086 Compare October 24, 2026 09:13
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 554460a to 398b984 Compare October 24, 2026 23:20
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch from 06ce086 to bc01a6b Compare October 24, 2026 23:20
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 398b984 to 9c44c01 Compare October 24, 2026 23:52
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch 2 times, most recently from 51ad9a5 to e84b4dd Compare October 25, 2026 00:02
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch 2 times, most recently from ad091bc to b1e5b73 Compare October 25, 2026 00:20
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch 2 times, most recently from 3a9c5fc to 37a2243 Compare October 25, 2026 00:45
@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-undo-live branch from 37a2243 to 000c3ae Compare October 25, 2026 01:47
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch from 000c3ae to 6202b06 Compare October 25, 2026 02:21
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 5b6cd87 to 391f26d Compare October 25, 2026 02:21
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 391f26d to 304cde7 Compare October 25, 2026 06:31
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch from 54d3284 to 7f65e3f Compare October 25, 2026 06:31
@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-undo-live branch 2 times, most recently from 4b73405 to 553897e 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-undo-live branch from 553897e to 5e37bf6 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 18 commits October 25, 2026 05:11
…ive, each with its history once

The undo e2e now follows a real move: main's own Sleep pauses a split tab, the committed move runs
its desktop rewrite and retention at startup, the window reloads three times and the app restarts,
then "Use on this computer again". The project comes back slept (no live terminal until opened),
and opening it wakes both panes from their checkpoints, history once, taking input.

Co-Authored-By: Claude <[email protected]>
… reloads and undo

The move e2e now carries the pane's idle Codex session to the host (its session file where the
distro keeps it): the agent resumes in the moved pane's folder on the first open and no reload
resumes it again. The undo e2e gives pane A an idle agent: after the undo it resumes there, once,
and pane B starts none.

Verify-6 item 5d (an idle agent read as working): the awin stub posts Codex's SessionStart at
launch, which Orca reads as a turn start; Codex posts it with the first prompt. The gate test now
pins that a resumed agent passes until its next prompt starts a turn.

Co-Authored-By: Claude <[email protected]>
…mand

A login shell may reset PATH (Ubuntu CI did), so the stub is named by the launch config the move
carries, as a recorded agent command is.

Co-Authored-By: Claude <[email protected]>
…ed pane's folder check

Blacksmith's /etc/profile.d/blacksmith.sh ends with cd "$GITHUB_WORKSPACE", so every login
shell on CI, restored or new, plain or agent, starts there. Reproduced in Ubuntu 24.04 with the
same profile line: a plain restored pane lands in GITHUB_WORKSPACE too, and with it unset the
moved pane and its resumed agent start in the pane's folder. Orca spawns the shell in the right
folder; the runner's profile moves it.

Co-Authored-By: Claude <[email protected]>
…tarted

Blacksmith's /etc/profile.d/blacksmith.sh sources the job env and cds into GITHUB_WORKSPACE, so on
CI every login shell, plain or agent, restored or new, moves there after Orca starts it in the
pane's folder (reproduced in Ubuntu 24.04 with that profile line; a plain restored pane moves too).
The check now accepts the pane's folder as PWD or as the OLDPWD a profile cd left behind.

Co-Authored-By: Claude <[email protected]>
…agents resume here

"Use on this computer again" resumed the project's agents here while the host's copies kept
running, so one agent session ran on both sides and two writers shared its transcript (awin
verify-7, 6c). Undo now sleeps the project's workspaces on the host and waits until none of their
terminals runs. A host that does not answer, or whose terminals do not exit, keeps the move and
says so; a host the user removed runs nothing, so the project comes back.

Co-Authored-By: Claude <[email protected]>
…roject comes back

A paired host holds the moved project under the move's ids with its terminal still running; after
"Use on this computer again" none of the host's terminals for it runs. Fails with the host stop
removed (the host's terminal stays at 1).

Co-Authored-By: Claude <[email protected]>
…e's own unsaved files

An unsaved file in any project refused bringing a moved project back, so p6's draft README
blocked undoing p9 (awin verify-8). The window reload no longer stops on an unsaved file, and
only the move's own workspaces come back from their pre-move state. The window now tells main
which workspaces have unsaved files; main refuses only if the move holds one of them, before it
stops anything on the host, and the window names just those files.

Co-Authored-By: Claude <[email protected]>
…t's terminals running

Undo stopped the host's copies of the move's terminals before it checked whether the move could
be released, so an undo refused because a later move builds on it still killed the host's shells
and agents; the agents then resumed again (awin verify-9, X1). Undo now runs every refusal first:
unsaved files, a running move, a newer move in the chain, and whether the host answers for every
workspace. Only then does it stop anything, and a host that cannot answer for one workspace has
none of them stopped.

Co-Authored-By: Claude <[email protected]>
…d since a relaunch

A pane the window has not shown since an app relaunch has no spawn-time pane key in main, so
the move gate's guest busy check could not find its shell. The gate now falls back to main's
own pane record. The Sleep half of the relaunch gap (awin verify-9, X2) moved to main with
#33398 and #33425.

Co-Authored-By: Claude <[email protected]>
…estore came with it

After an undo reload a restored, inactive terminal tab showed only a prompt: something spawned
its session 2 s after the reload, before the window showed it, and its checkpoint never replayed
(awin verify-10). No log named the spawner. Each WSL pane spawn or reattach now logs its
session, spawn intent, whether it was new, whether a cold restore came with it, and the four
caller frames above the daemon client, for verify-11 to capture.

Co-Authored-By: Claude <[email protected]>
…timeout

Main's flaky-test ratchet flags an unexplained per-test timeout.

Co-Authored-By: Claude <[email protected]>
…mon router

verify-11's `[wsl-spawn-origin]` lines named only the daemon client's own frames
(createOrAttachSpawn ← doSpawn ← withDaemonRetry): the async spawn path drops the caller.
The caller's frames are now captured synchronously at the router's `spawn` entry and logged
with the spawn, so verify-12 can name what starts a restored pane before its window shows it.

Co-Authored-By: Claude <[email protected]>
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-e2e-undo branch from 23add1b to 953b086 Compare October 25, 2026 12:15
@nwparker
nwparker force-pushed the nwparker/wsl-mover-restore-undo-live branch from 5e37bf6 to 91cb91f Compare October 25, 2026 12:15
nwparker and others added 2 commits October 25, 2026 05:35
…wn enters

verify-12 still logged "caller":[]. The router only wraps the daemon client when
legacy daemons exist; otherwise the bare client is the installed provider, so the
router capture never ran. Capture at the client's spawn entry (keyed by the
minted id too) and raise the stack limit so the async caller frames survive.

Co-Authored-By: Claude <[email protected]>
…estores

verify-13's second-cycle `$ $` checkpoint shows the daemon's own screen
without the fresh-shell blanking (old prompt still in the viewport,
scrollbackLines 0), which the macOS daemon harness never reproduces.
Log the seed's shape and tail with the spawn, and the daemon's screen
3 s after a WSL cold restore, so the next run shows where it is lost.

Co-Authored-By: Claude <[email protected]>
…ng undo

"Use on this computer again" slept the host workspace and waited for its
terminals to go. A host pane open in the window saw its terminal exit and
resumed the agent on the host 1.6 s later, after the stop had already
counted zero, so the reloaded window resumed a second copy here (awin
verify-14, 6c). Refuse this window's terminal and agent starts on that host
from before the stop until the reloaded page has loaded (capped at 2 min),
and lift the fence when undo is refused.

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