Skip to content

feat(wsl-mover): D3a-2 move status line on WSL host rows (dark) - #34676

Merged
nwparker merged 7 commits into
mainfrom
nwparker/wsl-d3a-2-status-line
Oct 28, 2026
Merged

nwparker merged 7 commits into
mainfrom
nwparker/wsl-d3a-2-status-line

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​570 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​546
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​483 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​466

ELI5

Orca can now move WSL projects onto a server inside each distro on its own (the D3a "orchestrator", #33802). Sometimes that move has to wait: terminals are busy, the user brought the projects back, or an earlier move never finished settling. Until now the user saw nothing about that. This PR adds one short status line per distro under its row in Settings → WSL hosts, plus a toast when a move finishes or stops to wait for the user. Like the rest of the mover, it only shows in internal builds started with ORCA_INTERNAL_WSL_HOSTS=1.

What Changed

What the user sees (one line per distro, only while something needs saying):

  • Terminals busy: "Finishing your move to the {distro} host: some terminals are still busy.", plus what's blocking and how to clear it. Buttons: Show terminal opens the busy pane so the user can stop it themselves (Orca never ends it). Check again looks again now.
  • Stuck: "An earlier move to the {distro} host hasn't finished settling." with Check again. It never says the move failed.
  • Paused for the user (state that can't be carried yet, too much state, the host needs an update, or several tries didn't complete): "Moving projects to the {distro} host is paused: {short reason}." with Check again.
  • Declined by "Use on this computer again": "Moving is paused because you brought these projects back to this computer." with Move again only. There's no "Not now", which would turn the decline into a 7-day snooze.
  • Declined by a Remove of the host, or a Remove still pending: nothing. The host row already says what's happening, and re-adding the host clears the decline.
  • Toasts: one when a distro becomes done, and one when it parks, only for live changes, never for what was already there on load. "Show terminal" toasts if that terminal is no longer open.

How it works:

  • Main:
    • parked: declined now records its cause (released-here or removed), so the renderer doesn't have to guess.
    • The orchestrator prunes records of distros that have neither a WSL host nor a not-yet-moved bridge project (wsl-move-distro-in-use.ts). It never prunes a user's own choice (declined, Not now). A host file it can't read counts as "in use".
  • "Check again" runs as the user's own act. The orchestrator's user steps run inside runAsWslUserAct(distro), so the driver's reads of a just-connected distro aren't refused by the stopped-distro gates (fix(wsl): background repo probes, PR refresh and worktree scans never start a stopped distro (E9) #34632). Wakes and timers stay background work (A1).
  • Renderer:
    • A small store (wsl-move-orchestrator-status.ts) loads the records with wslMove.listOrchestrator and follows onOrchestratorStatus. It's mounted in WslMoveDialogHost only while WSL hosts are enabled.
    • The line (WslMoveOrchestratorStatusLine) renders in the host row's ServerListRow footer, using existing tokens and Button xs/outline. Its copy is in wsl-move-orchestrator-copy.ts.
    • The new strings go through the normal i18n catalog sync.

Why

The orchestrator's states only matter if the user can see and act on the ones that wait for them. One line on the host row, rather than a dialog or a banner, keeps the surface small, which the owner asked for.

The decline cause is stored in main rather than inferred in the renderer from whether the host row exists, because inferring loses to a race with a re-add. Pruning lives in main so stale records never reach any client.

"Show terminal" instead of a real "End" keeps any way of killing a process off this line.

Linked Issue

N/A (internal tracker: D3a-2)

Visual Proof

Taken with CDP on a hidden window (ORCA_BACKGROUND_LAUNCH=1). The dev build used fake WSL hosts on a throwaway profile, with Ubuntu stuck and Debian waiting on a working agent:

WSL hosts rows: Debian waiting on busy terminals, Ubuntu stuck

Testing

  • Automated tests added. Flag-off checks:

    1. With WSL hosts off, the host row shows no line even when a record is present.
    2. With hosts off, the window never calls listOrchestrator or onOrchestratorStatus; with hosts on, it does.
    3. In the real web preload harness, the list is empty, nothing calls back, and the store stays empty.
    4. Hydrating a parked state gives no toast; a live change to parked or done toasts once.
    5. Each state's line and buttons, including no "fail" anywhere and no "Not now" on a declined distro.

    Main: decline causes, pruning (never a user choice, never on an unreadable host file), wiring, and that the driver runs as the user's act only for "Check again".

  • Manually tested by CDP screenshot on macOS with fake WSL hosts (above). That run also caught a renderer bundle break: a shared module pulled in node:crypto. It's fixed.

  • Local checks: typecheck:ci, oxlint on the touched files, check:code-quality:changed, the localization checks, and the D3a suites (1609 tests across 226 files).

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Dark: nothing changes without ORCA_INTERNAL_WSL_HOSTS=1. Main constructs nothing, the preload has no WSL host API, and the renderer neither reads nor subscribes.
  • Platform: WSL is Windows-only in practice. The fake-host path makes it testable on macOS and Linux.
  • SSH and mobile: untouched. The web client keeps its inert stubs.
  • Sidecar compatibility: cause is optional, so older builds still read declined.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker
nwparker changed the base branch from nwparker/wsl-mover-land-2 to main October 28, 2026 07:14
@nwparker
nwparker force-pushed the nwparker/wsl-d3a-2-status-line branch from bf22142 to 3c93a4e Compare October 28, 2026 07:14
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73a8f61a-6c39-421e-84a2-b054d9863368
Commits

Reviewing files that changed from the base of the PR and between 7cdfebd and 3c93a4e.

Files selected for processing: 24
  • src/main/ipc/wsl-move-distro-in-use.ts
  • src/main/ipc/wsl-move-orchestrator-host-connect.test.ts
  • src/main/ipc/wsl-move-orchestrator-wiring.test.ts
  • src/main/ipc/wsl-move-orchestrator-wiring.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-driver.test.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-external-transitions.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-ports.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-store.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-transitions.test.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator-user-choices.test.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator.test-support.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator.test.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-orchestrator.ts
  • src/main/telemetry/wsl-move-orchestrator-telemetry.test.ts
  • src/renderer/src/components/settings/WslHostsSection.tsx
  • src/renderer/src/components/wsl-move/WslMoveDialog.tsx
  • src/renderer/src/components/wsl-move/WslMoveOrchestratorStatusLine.tsx
  • src/renderer/src/components/wsl-move/wsl-move-orchestrator-copy.ts
  • src/renderer/src/components/wsl-move/wsl-move-orchestrator-flag-off.test.tsx
  • src/renderer/src/components/wsl-move/wsl-move-orchestrator-status.test.tsx
  • src/renderer/src/components/wsl-move/wsl-move-orchestrator-status.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/web/web-preload-api-wsl-move-orchestrator.test.ts
  • src/shared/wsl-move/wsl-move-orchestrator-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The orchestrator now records why a move was declined, prunes eligible records for unused distros, and runs user-triggered steps through a dedicated port. Main-process wiring checks whether a distro is in use and supplies distinct causes for local release and host removal. The renderer subscribes to orchestrator status and displays status text, blockers, and actions when WSL hosts are enabled.

Priority: Normal

Merge Risk: Minimal · up to 3c93a

The reviewed WSL move status and pruning paths show no identified issue requiring a fix before merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "feat(wsl-mover): D3a-2 move status line on WSL host rows (dark)" names the main change: a per-distro move status line on WSL host rows in Settings. The changeset adds this status line compo…
Description check Passed The description follows the template closely. It has an ELI5, What Changed (with user-visible before/after behavior and mechanism), Why (with alternatives considered), Visual Proof (a before/after-sty…
Docstring Coverage Passed Docstring coverage is 84.62% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(wsl-mover): D3a-2 move status line on WSL host rows (dark)" names the main change: a per-distro move status line on WSL host rows in Settings. The changeset adds this status line component, the renderer store, and the copy helpers, so the title matches the primary change. The title uses internal phase jargon (D3a-2) and a scope tag, and it omits the toasts and main-process pruning. These points are minor and do not make the title unrelated or vague.

Full details: Description check

Explanation

The description follows the template closely. It has an ELI5, What Changed (with user-visible before/after behavior and mechanism), Why (with alternatives considered), Visual Proof (a before/after-style screenshot, though only one state is shown and no explicit BEFORE image is attached), Testing with checklist items, AI Disclosure, Review and Notes sections, and a Checklist. Gaps: the Linked Issue section reads 'N/A (internal tracker: D3a-2)' rather than a linked issue, the Visual Proof section has no clearly labeled before and after pair, the AI Disclosure section is empty, and the final checklist item for lint, typecheck, test, and build is unchecked. The template's Linked Issue section says an issue should always be linked for outside contributors. This author appears to be an internal contributor, so the requirement may not apply. Overall the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 84.62% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 23 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit bb10b80 into main Oct 28, 2026
60 checks passed
nwparker added a commit that referenced this pull request Oct 28, 2026
#34676's test mocks use-wsl-hosts-enabled; WslHostsSection now also reads
useWslHostsAcceptNewWork, which follows the same gate there.
nwparker added a commit that referenced this pull request Oct 28, 2026
Main's move status line (#34676) names every park reason; the finish-pending reason this PR adds
needs one: the earlier move is done on the host, and finishes here at restart or with Check again.
nwparker added a commit that referenced this pull request Oct 28, 2026
…e host's server update during a move (#34823)

* fix(wsl-mover): settle an interrupted move automatically, and hold the host's server update during a move

An app update or crash between sending a move's copy and the host's commit leaves a
`blobs-transferred` record. Startup recovery has no host to ask, so the projects stay fenced, and
the automatic mover only previewed, which refuses an in-flight move, retrying forever. The
projects stayed read-only until the user started the move from the dialog. The automatic mover's
preview now settles that record first (through the host: back to zero, or forward when the host
committed), holding the distro's run while it does so it never races a move the user starts. The
dialog's preview stays read-only. The preview moves to its own module.

A Settings Update or Force, or any reconnect, could also redeploy the host's server in the middle
of a move, cutting it off (safe, but the move is lost). Once a running move has journaled, a
version-changing redeploy now keeps the running server and reports the update as waiting for the
move, mirroring the SSH path's skip while migrating. The move's own first connect, before it
journals, can still update an outdated server.

* fix(wsl-mover): an automatic settle never reloads the window, and never holds its own host update

Review of #34823:
- A settle that finds the host committed ran the desktop rewrite, which reloads the window past
  its unload veto. From the automatic mover it now records the commit only (the projects stay
  fenced), and the next start's rewrite pass finishes it before any window opens. A move the user
  starts still finishes at once.
- The server hold counted any unfinished record of the distro, so an automatic settle of an old
  record with an outdated server was held, refused for an update, and retried the same way. The
  hold now counts only the cutover the running move journaled itself.

* fix(wsl-mover): let the user finish a committed move in-session; park the automatic mover meanwhile

After an automatic settle records a commit for the next start, nothing could finish it in-session:
the user's Move refused as already in flight and the orchestrator retried for nothing.

- A settle that finds the head committed but not yet rewritten on this desktop finishes it now when
  the user asked (their Move, or the status line's Retry), returning the existing "finished an
  earlier move" answer; the automatic mover still leaves it for the next start.
- The automatic refusal carries detail `finish-pending`, which parks the distro (new reason
  `finish-pending`) instead of retrying; the next start, whose rewrite pass finishes the move before
  any window opens, puts it back to pending.
- The park rules move to wsl-move-orchestrator-park.ts.

* fix(wsl-mover): give the finish-pending park its own status line

Main's move status line (#34676) names every park reason; the finish-pending reason this PR adds
needs one: the earlier move is done on the host, and finishes here at restart or with Check again.
nwparker added a commit that referenced this pull request Oct 28, 2026
…/2) (#34694)

* feat(wsl): admit no new WSL host or move in serve-only

Main refuses wslHosts:add while the internal gate is closed and reports
acceptsNewWork in the WSL host capability; moves already need the open gate.
The renderer hides Add WSL distro and every Move entry point once main says
serve-only, while saved hosts keep their Connect and Remove.

* fix(wsl): offer no new WSL host or move until main answers the capability

The renderer's acceptsNewWork now starts false, so Add WSL distro and the Move
entries never flash in serve-only before the capability reply.

* fix(wsl): point the WSL-bridge chat refusal at Add WSL distro only when it is offered

In serve-only Add WSL distro is hidden, so the refusal keeps its terminal-only
words there.

* test(wsl): give the move status-line test's hosts mock the new-work hook

#34676's test mocks use-wsl-hosts-enabled; WslHostsSection now also reads
useWslHostsAcceptNewWork, which follows the same gate there.
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