Repository navigation
feat(wsl-mover): a moved pane reopens in its last folder on the WSL host (D1b-6b) - #28885
Conversation
…pe it to its worktree, retry failed installs (D1b-6b)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When Orca moves a WSL project onto its WSL host, it pauses the project's terminals first and records which folder each pane was in. This PR carries those folders to the host. The first time a moved pane's terminal opens there, it starts back in that folder instead of the project root. Nothing sends the folders yet; the move flow that sends them comes later.
What Changed
This is step D1b-6b of the lossless WSL project mover. It rides on the blob channel from #28866.
src/shared/orcad-migration-terminal-restore-hints.ts): a versioned JSON document{version: 1, hints: [{paneKey, cwd}]}.tabId:<uuid>.//or NUL.buildWslMoveRestoreHintsBlob) produces the blob for the move flow to send.<profile>/orcad-migration-blobs/installed/terminal-restore-hints.json) rather than into profile state, so neither persisted state nor the wire format changes. Each hint carries its worktree and migration, and expires after 30 days. The installed-migration record means a commit retry never brings back a hint that was already used. The received blob is then deleted.orca-runtime-create-terminal.ts). The pane is claimed first, then the hint is read.orcad.migration-blob.terminal-restore-hints.v1.Why
The owner decided on "pause and restore" for terminals. Restoring a shell at the project root instead of where the user was is a silent loss. The folder lives only in the paused terminal's daemon checkpoint on the desktop, so it has to travel with the move. It's captured after the terminals pause, while the manifest is signed earlier, so it travels as a blob rather than in the manifest. That also keeps SSH manifests byte-identical.
Linked Issue
N/A (maintainer; tracked in the WSL-via-orcad implementation tracker, step D1b-6).
Visual Proof
N/A: no UI change, and nothing sends hints yet.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Format: a bad pane key, a relative folder and an oversize document are refused; the encoder round-trips.
Install, using a real store:
Terminal creation:
Checks: the capability is advertised, the SSH manifest golden digest is unchanged, and
pnpm tc:node, both oxlint configs and the changed-code quality gate pass. The only failing unit test,orca-runtime-agent-session-operation.test.ts, fails the same way on main.Adversarial review: found two MEDIUM issues (a hint used up before the spawn succeeded; a stale hint reaching a later reopen) and three LOW ones (failed installs never retried, a pause before the pane claim, unenterable folders accepted). All are fixed here.
AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)