Skip to content

feat(wsl): say WSL hosts are paused in serve-only (kill switch 3) - #34868

Merged
nwparker merged 3 commits into
mainfrom
nwparker/wsl-kill-switch-paused-notice
Oct 28, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/wsl-kill-switch-paused-notice

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​46

Based on main at 0cca424b515 (after #34683 and #34694 merged).

ELI5

In serve-only (the internal WSL hosts switch is off, but this profile already has WSL hosts or moved projects), the previous PRs keep saved hosts working and quietly remove Add WSL distro and the Move entries. This PR tells the user why: their saved hosts and projects keep working, and adding hosts and moving projects is paused.

What Changed

  • Settings → WSL hosts: in serve-only, the section's description line reads "WSL hosts are paused in this build. Your saved hosts and their projects keep working; adding hosts and moving projects onto them is paused." It uses the same line the section already uses for "turned off" and "server files missing", and those keep precedence. The host rows are unchanged: status, Connect and Remove.
  • Add a project → Add remote host: where "Add WSL distro" would be, a muted line says "Adding WSL distros is paused in this build." It's a new optional prop on AddRepoHostSelector, wslHostsPausedNote, passed only by AddRepoHostSelectorSlot.
  • State:
    • Store: wslHostsNewWorkPaused is true only once main's capability answers acceptsNewWork: false. It starts false, so neither an open gate nor a closed one ever shows it.
    • Hook: useWslHostsPaused() also requires the WSL API to be exposed.
  • Labels and strings: two labels in wsl-host-row-status.ts. Their English strings were added to en.json with sync:localization-catalog.

Not on terminals or the file explorer. selectWslHostUnavailableReason drives a blocking notice there that takes over the pane. Paused hosts work, so adding "paused" as an unavailable reason would hide working terminals. The notice stays where users look for the missing Add and Move entries.

Flag-off: with the gate open or closed, wslHostsNewWorkPaused stays false and nothing renders.

Why

Without it, a user in serve-only sees Add WSL distro and Move silently disappear. The copy follows the existing description slot and the muted secondary-text pattern in the same menu (docs/STYLEGUIDE.md). It adds no new primitive or color.

Linked Issue

N/A (WSL hosts kill switch, PR3 of the design).

Visual Proof

Taken by the hidden e2e serve-only case through CDP (ORCA_BACKGROUND_LAUNCH=1): wsl-hosts-serve-only-settings.png (Settings with the paused line, and the saved Ubuntu host Connected) and wsl-hosts-paused-add-host-menu.png (the add-host menu with the paused line instead of Add WSL distro). The gh image upload failed here because there's no browser session token, so the images are in the e2e test results and will be attached by hand.

Testing

  • use-wsl-hosts-enabled.test.tsx:

    • no paused notice before main answers or with the gate open;
    • shown once main answers serve-only;
    • never shown where the WSL API isn't exposed (closed).
  • AddRepoHostSelector.test.tsx: the paused line renders only when given, in place of Add WSL distro.

  • e2e wsl-host-fake-transport.spec.ts:

    • the serve-only case asserts both lines and takes both screenshots, and now closes the add-project dialog before the Settings screenshot;
    • the closed case asserts no paused text.
    • Both pass locally, hidden.
  • pnpm tc, typecheck:ci, oxlint, the anti-slop lint, ast-grep-gates.mjs, check:code-quality:changed, check:process-host-imports and the localization checks (catalog, extraction, runtime catalog) pass. The 7 affected suites pass (45 tests).

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Risk: low.

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

Renderer-only. There's no wire, SSH or mobile impact. Not here: the remote policy fetcher (PR4/5 of the design), which needs owner sign-off.

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 force-pushed the nwparker/wsl-kill-switch-block-entry-points branch from bd357a7 to f6217cd Compare October 28, 2026 08:14
@nwparker
nwparker force-pushed the nwparker/wsl-kill-switch-paused-notice branch 2 times, most recently from 2f3060a to 3f4f244 Compare October 28, 2026 09:26
@nwparker
nwparker changed the base branch from nwparker/wsl-kill-switch-block-entry-points to main October 28, 2026 09:26
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

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: 797bba38-dc9b-4a23-b5c6-98aeb4f35028
Commits

Reviewing files that changed from the base of the PR and between 3f4f244 and b723640.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Walkthrough

The WSL hosts slice now tracks whether new work is paused. A hook exposes that state when WSL-host APIs are available. Settings and the add-host menu display translated paused-status messages. Tests cover the hook state and verify the notices in component and end-to-end scenarios.

Priority: Low

Merge Risk: Low · previous review 3f4f2

Users may receive misleading WSL availability guidance in these configurations; the localized gating fix is small and should be applied.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: showing that WSL hosts are paused in serve-only mode.
Description check Passed The description follows the required structure and explains the user-facing behavior, implementation, rationale, testing, scope, and compatibility impact. It notes that the linked issue is N/A, visual…
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: Description check

Explanation

The description follows the required structure and explains the user-facing behavior, implementation, rationale, testing, scope, and compatibility impact. It notes that the linked issue is N/A, visual attachments still need manual upload, and the full lint, typecheck, test, and build checklist remains unchecked, but the description is otherwise complete and focused.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. 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 4 functions across 10 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


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: 1db14856-1724-435a-80c3-a68796f7e912
Commits

Reviewing files that changed from the base of the PR and between 2d3e7e4 and 3f4f244.

Files selected for processing: 11
  • src/renderer/src/components/settings/WslHostsSection.tsx
  • src/renderer/src/components/sidebar/AddRepoHostSelector.test.tsx
  • src/renderer/src/components/sidebar/AddRepoHostSelector.tsx
  • src/renderer/src/components/sidebar/AddRepoHostSelectorSlot.tsx
  • src/renderer/src/components/sidebar/use-wsl-hosts-enabled.test.tsx
  • src/renderer/src/components/sidebar/use-wsl-hosts-enabled.ts
  • src/renderer/src/components/sidebar/wsl-host-row-status.ts
  • src/renderer/src/components/wsl-move/wsl-move-orchestrator-flag-off.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/wsl-hosts.ts
  • tests/e2e/wsl-host-fake-transport.spec.ts

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

Comment on lines 30 to 36
onAddSshHost={() => setAddRemoteHostMode('ssh')}
onAddRemoteServer={() => setAddRemoteHostMode('server')}
onAddWslHost={wslHostsAcceptNewWork ? () => setAddRemoteHostMode('wsl') : undefined}
wslHostsPausedNote={wslHostsPaused ? getWslHostsPausedShortLabel() : undefined}
onOpenWslHostsSetting={openWslHostsExperimentalSetting}
/>
<AddRemoteHostDialog mode={addRemoteHostMode} onOpenChange={setAddRemoteHostMode} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

sed -n '1,90p' src/renderer/src/components/sidebar/AddRepoHostSelectorSlot.tsx
sed -n '170,225p' src/renderer/src/components/sidebar/AddRepoHostSelector.tsx
rg -n "serverFiles|experimentalWslHosts|WslHostsPaused|paused.*WSL|Add WSL distro|Turn on in Experimental" src/renderer/src/components/sidebar src/renderer/src/components/settings src/renderer/src/components/sidebar/*.test.tsx tests/e2e/wsl-host-fake-transport.spec.ts

Repository: stablyai/orca

Length of output: 14974


Script executed:

set -o pipefail
printf '%s\n' '--- use-wsl-hosts-enabled.ts ---'
nl -ba src/renderer/src/components/sidebar/use-wsl-hosts-enabled.ts | sed -n '1,80p'
printf '%s\n' '--- use-wsl-hosts-enabled.test.tsx ---'
nl -ba src/renderer/src/components/sidebar/use-wsl-hosts-enabled.test.tsx | sed -n '1,110p'
printf '%s\n' '--- AddRepoHostSelector.test.tsx relevant block ---'
nl -ba src/renderer/src/components/sidebar/AddRepoHostSelector.test.tsx | sed -n '130,255p'
printf '%s\n' '--- WSL host file hook and selector-related consumers ---'
rg -n -F -- 'useWslHostServerFilesMissing' src/renderer/src/components/sidebar src/renderer/src/components/settings
printf '%s\n' '--- e2e state cases ---'
nl -ba tests/e2e/wsl-host-fake-transport.spec.ts | sed -n '480,710p'

Repository: stablyai/orca

Length of output: 21591


Gate the paused note by the active WSL state.

useWslHostsPaused() does not check whether the experiment is enabled or whether server files exist. When the API is exposed, the add-host menu can therefore show “Adding WSL distros is paused” while WSL hosts are turned off, or while the build cannot support WSL hosts. This replaces the existing disabled or unavailable behavior.

Suggested fix
 import {
   openWslHostsExperimentalSetting,
+  useWslHostServerFilesMissing,
   useWslHostsAcceptNewWork,
+  useWslHostsEnabled,
   useWslHostsPaused
 } from './use-wsl-hosts-enabled'
@@
   const wslHostsAcceptNewWork = useWslHostsAcceptNewWork()
+  const wslHostsEnabled = useWslHostsEnabled()
+  const wslHostServerFilesMissing = useWslHostServerFilesMissing()
   const wslHostsPaused = useWslHostsPaused()
@@
-        wslHostsPausedNote={wslHostsPaused ? getWslHostsPausedShortLabel() : undefined}
+        wslHostsPausedNote={
+          wslHostsPaused && wslHostsEnabled && !wslHostServerFilesMissing
+            ? getWslHostsPausedShortLabel()
+            : undefined
+        }

Settings → WSL hosts explains that saved hosts and their projects keep working
while adding hosts and moving projects is paused, and the add-host menu says
where Add WSL distro went. Shown only after main answers serve-only, so open
and closed gates never show it.
@nwparker
nwparker force-pushed the nwparker/wsl-kill-switch-paused-notice branch from 3f4f244 to b723640 Compare October 28, 2026 09:54
@nwparker
nwparker merged commit 30e75d9 into main Oct 28, 2026
40 checks passed
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