Skip to content

fix(wsl-mover): a split agent tab's shell panes restart as shells, not fresh agents - #32400

Closed
nwparker wants to merge 1 commit into
nwparker/wsl-mover-p0-fixesfrom
nwparker/wsl-mover-p1-split-shells
Closed

nwparker wants to merge 1 commit into
nwparker/wsl-mover-p0-fixesfrom
nwparker/wsl-mover-p1-split-shells

Conversation

@nwparker

@nwparker nwparker commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​110 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​110
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

Stacked on #32343. Behind ORCA_INTERNAL_WSL_HOSTS for the mover; the shared path it touches is the headless start of a saved pane (paired clients, SSH-managed and WSL hosts). Not for merge until the stack is reviewed.

Summary

After a WSL move, a plain shell split beside an agent pane came back as a new agent with a new session, and lost its folder (D1b-10 real-host run on awin, report bug 6).

Before / after

  • Before: an agent tab holding an agent pane plus two shell splits restored as three agents; the two splits ran fresh codex sessions.
  • After: the agent pane resumes its recorded session; the splits start as plain shells.

Mechanism

When a host starts a saved pane with no live terminal (materializePendingMobileSessionTerminal), a pane with no recorded agent session fell back to the tab-wide launchAgent and launched that agent. launchAgent describes the tab, not a pane. The fallback (and the launchAgent label on the spawn) now applies only when the tab has a single pane, the same rule the renderer already uses for tab-wide launch evidence.

Why this approach

The per-pane sleeping record already says which pane ran an agent; only the tab-wide fallback was wrong. Keeping the fallback for single-pane tabs preserves the #7587 rescue (a pending agent tab whose startup command never arrived).

Testing

  • New mobile-session-tabs-split-agent-tab.spec.ts: split sibling starts as a shell (fails on the old code), the recording pane still resumes, and no pane starts a fresh agent without a record (fails on the old code).
  • orca-runtime.test.ts: 1455 pass; the 2 failing folder-import tests fail the same way on the base commit.
  • pnpm tc and the changed-code quality gate pass.

@nwparker

Copy link
Copy Markdown
Contributor Author

Standalone version for main: #32418, which is the same change. When the stack is next rebased onto a main that has #32418, drop this commit (ebee49bb367f), for example with git rebase --onto <new-main> ebee49bb367f. Otherwise it conflicts on the same lines. Its spec is identical, and the comment text is aligned.

@nwparker

Copy link
Copy Markdown
Contributor Author

Restacked on #32343 7f62612. This commit is now 23adc7b99a97. Once #32418 lands, drop it when the stack is next rebased onto main: git rebase --onto <new-main> 23adc7b99a97.

…t fresh agents

A moved (or any headless-restored) agent tab with a plain shell split beside the agent
pane brought every split back as a new agent: the start path used the tab-wide
launchAgent for each pane that had no recorded session. Tab-wide launch evidence now
applies only to a tab's sole pane, as the renderer already treats it.

Found in the D1b-10 real-host run on awin (report bug 6).

Co-Authored-By: Claude <noreply@anthropic.com>
@nwparker
nwparker force-pushed the nwparker/wsl-mover-p1-split-shells branch from 23adc7b to 501641f Compare October 23, 2026 15:41
@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