You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(wsl): background Git, GitHub and GitLab reads never start a stopped distro; explicit opens may (E9) - #35410
If you stop a WSL distro, Orca should leave it stopped until you do something in it. Several background readers kept starting it again on their own: the Git and GitHub/GitLab polls, and checks that run when a page opens. Now they wait. Opening something yourself (a diff, the Commits list, the checks panel) still starts the distro, because that's you asking for it.
What Changed
Before: after wsl --terminate, these reads could start the distro again within seconds, with no click:
Git followers: history, diff, branch and commit diffs, submodule status, ignore checks, the huge-folder scan;
the 5-minute issue poll on sidebar cards, the hosted-review card poll (every provider, GitLab included), the Tasks list and count, and the checks panel poll (GitHub and GitLab);
the speculative create-base prefetch when the composer opens;
the worktree-root setup that runs for every repo after a workspace-folder settings edit;
the orca.yaml check behind the Settings project page, the Automations create dialog, and the composer.
After: each read checks the existing settled gate first (assertWslUncPathRunning / blockedWslDistroForPath, with a 60 s lease), and covers the project's distro, not only \\wsl.localhost paths. What happens next depends on who asked.
Background reads are refused while the distro is stopped. These are polls, timers, refreshes after a Git action, prefetches and fan-outs.
Git and GitHub reads refuse with the existing "WSL distro is not running" error.
Prefetch and root setup skip the repo.
Settings, Automations and the composer ask in background mode. A repo whose distro refused, or didn't answer, stays "checking" rather than "no orca.yaml", and Settings re-asks on window focus, on visibility and every 10 s until it answers.
The sidebar issue poll says "Open a terminal in it to start it", because its own retry is background too. Tasks and the checks panel keep "Retry", since their Refresh/Retry are user acts.
gh:prForBranch (the card fallback when the refresh coordinator is absent) is gated like the other card polls.
On a refusal, pollers keep what they already show: a card's issue, the checks list, an open diff, loaded submodule children. They also stop logging it.
Explicit opens are user acts and may boot the distro. Each one runs under runAsWslUserAct for that distro, via a wakeWslDistro flag on git:diff, git:branchDiff, git:commitDiff, git:history and gh:prChecks:
showing a diff tab, or its Retry;
showing Commits (expanding it, or switching to a workspace with it open), or its Refresh button;
opening the checks panel or entering its tab (the first read after open), checks Refresh, a check action, and linking or creating a PR;
Create in the composer and saving an automation, which re-check orca.yaml in the foreground and never reuse a refused background check;
a Tasks Refresh, Retry or search, or Tasks opened on a single repo (gh:listWorkItems / gh:countWorkItems; a multi-repo open stays background);
an explicit review-status refresh (hostedReview:forBranch with wakeWslDistro, set by the checks panel's manual Refresh and by the refresh that follows a review the user created, linked or edited), so GitLab, Bitbucket, Azure DevOps and Gitea reviews with nothing cached can load. admissionTier stays priority only: the visible scheduler sends 'interactive' for the selected card on a timer, and that poll is refused;
a manual PR lookup through gh:prForBranch.
User acts that already started a distro are unchanged: opening a terminal, the active workspace's first status read, expanding the explorer, creating a worktree, and fetching.
Why
This is the GitHub and Git reader group (G1, G2, G4–G6, G8) from the E9 background-boot audit. Link existence checks (G3) are in #35412, which throws a refusal instead of answering "missing".
Gating in the main-process handler covers every caller, including renderer retries, timers and the web client. It copies the git:status pattern: gated by default, with a wake flag only where the user explicitly opened the thing. A new caller is safe without having to remember a flag.
Settings could store the refused result, but that would show "missing orca.yaml" and offer "Use local commands", which is wrong for a distro that's only stopped.
GitLab MR details use a background flag instead of a wake flag because most callers are explicit dialog opens.
Linked Issue
N/A (internal WSL rewrite, E9 audit follow-up)
Visual Proof
N/A: no new UI. A stopped distro now shows the last data, the existing stopped-distro error, or the existing "checking" state, instead of booting.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New tests, each confirmed to fail with its source change reverted:
filesystem-wsl-stopped-distro-git.test.ts:
7 Git channels refuse before resolving the path or running Git;
showing a diff or Commits may start the distro, but a reload or post-action refresh may not.
github-wsl-stopped-distro.test.ts:
gh:issue, gh:listWorkItems, gh:countWorkItems and gh:prChecks refuse without running gh;
for gh:prChecks, gh:listWorkItems, gh:countWorkItems and gh:prForBranch, a user act may start the distro but the next poll may not;
a Windows-host repo never asks WSL.
hosted-review.test.ts and gitlab.test.ts: the card poll, the interactive-priority scheduler poll and the GitLab checks poll refuse; an explicit review Refresh and an explicit GitLab open read.
visible-hosted-review-refresh-targets.test.ts: the scheduler's refresh of the selected card sends no wake; a card refresh does.
use-checks-panel-polling.test.tsx: the read that opens the panel wakes, later polls don't, and reopening wakes again (GitHub and GitLab).
use-git-history-wsl-wake.test.tsx: showing Commits and its Refresh wake; a ref-driven refresh doesn't.
wsl-stopped-distro-poll-refusal.test.ts:
a refused issue poll keeps the cached issue and doesn't log;
refused checks are served from cache quietly;
Refresh doesn't join an in-flight poll;
a Tasks user act sends the wake while a fan-out doesn't;
only a manual PR lookup fallback sends it.
worktrees-wsl-runtime-routing.test.ts, worktree-root-preparation.test.ts, use-automations-page-setup-state.test.tsx: prefetch, G8, and the Automations background/foreground split.
use-settings-repo-scroll-effects.test.tsx: Settings asks in the background, stays "checking" for a stopped or unverifiable distro, and records it once a focus or the 10 s retry finds it running.
worktree-hook-check-background-gate.test.ts: an unverifiable distro is marked unread.
github-wsl-stopped-distro.test.ts also checks the refusal wording per surface.
wsl-unc-access-gate.test.ts: the refusal is recognised in-process, over IPC and over RPC.
Also run: pnpm tc, pnpm run typecheck:ci, pnpm run check:code-quality:changed, the anti-slop lint, ast-grep, and the suites related to the changed files. Not run on Windows.
Flag-off: these paths don't check the WSL hosts flag, so the gate applies flag-off too. That's the point: the boots happened flag-off. With a running distro, behaviour is unchanged, apart from at most one shared wsl --list --running per minute.
User-risk: low. Background panels keep their last data while the distro is stopped, and anything the user opens explicitly starts it as before.
Opening Tasks on several repos never starts their distros; it shows cached items and a failure count until a Refresh or Retry.
If WSL doesn't answer the running check, the composer's open-time result still counts as "no orca.yaml hooks". This is a rare edge.
The renderer's hosted-review catch still logs a refusal with console.error. A filter would push hosted-review.ts over the 300-line limit. The cached review is kept.
AI Disclosure
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
SSH and remote: unaffected. The gate only names a distro on Windows, for WSL paths or projects.
Folder workspaces: the root fan-out already skips folder repos.
Wire: no RPC change. The web client strips the local-only wakeWslDistro and background hints. IPC args gain optional fields only.
The changes add WSL distro checks to selected main-process Git and provider reads. They add optional wake flags to local Git and GitHub requests, and distinguish user-visible reads from background polls in review and hook-check flows. Stopped or unverifiable distro refusals can preserve cached or displayed state. Settings hook checks retry after a timer or window focus or visibility event. Worktree preparation and speculative prefetch skip blocked distros.
Priority: Normal
Merge Risk: Moderate · previous review 8859b
A delayed checks poll can wake a stopped distro, and expected refusals produce repeated error logs. Fix these before merging. Existing worktree-root wake paths also remain.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 31.82% 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 checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly summarizes the main change: background Git, GitHub, and GitLab reads no longer start stopped WSL distros, while explicit opens may do so.
Description check
The description is detailed and covers the required explanation, changes, rationale, testing, visual proof, scope, compatibility notes, and checklist. The Linked Issue section uses N/A instead of an i…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is detailed and covers the required explanation, changes, rationale, testing, visual proof, scope, compatibility notes, and checklist. The Linked Issue section uses N/A instead of an issue link, but the description references related tracked work and is otherwise substantially complete.
Full details: Docstring Coverage
Explanation
Docstring coverage is 31.82% 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 22 functions across 58 files.
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.
The PR adds stopped-distro guards to background Git and hosted-review reads, while passing wake permission for explicit user actions.
Git reads check WSL before touching a stopped distro.
GitHub polls leave stopped WSL distros alone.
Hosted-review and GitLab polls leave stopped WSL distros alone.
Automatic setup checks wait instead of waking stopped WSL distros.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Read requested] --> B{Explicit user action?}
B -->|Yes| C[Pass wake permission]
C --> D[Read may start distro]
B -->|No| E[Check whether distro runs]
E -->|Running| F[Perform read]
E -->|Stopped or unknown| G[Refuse or skip]
G --> H[Keep cached data or retry later]
The reason will be displayed to describe this comment to others. Learn more.
Stopped destination distros still start
The new gate checks the repo path, not the configured worktree folder. If C:\repo has workspaceDir or worktreeBasePath set to \\wsl.localhost\Ubuntu\workspaces, this check passes without checking Ubuntu. computeWorkspaceRootAsync preserves that absolute path, and mkdir starts the stopped distro during the settings fan-out. Also check the destination before touching it, while keeping the existing gate before any WSL home probe.
nwparker
changed the title
fix(wsl): keep background git and GitHub reads from booting a stopped distro
fix(wsl): background Git, GitHub and GitLab reads never start a stopped distro; explicit opens may (E9)
Oct 28, 2026
STATUS: adopted by wsl-e9-git. Head f8eddc3. Folded #35429 in: explicit opens (diff tab/Retry, Commits shown/Refresh, checks panel open/tab entry/Refresh/actions) now run under runAsWslUserAct; polls, timers, post-action refreshes, prefetches and fan-outs stay refused. Added the hosted-review card poll, the GitLab checks poll, the composer hook check, and renderer keep-last-data on refusal. Checks: tc, typecheck:ci, check:code-quality:changed, anti-slop, ast-grep and related suites all pass; the remaining failures (real-git, real-watcher, cross-version-wire, electron-serve) also fail on main.
The reason will be displayed to describe this comment to others. Learn more.
Background updates restart stopped distros
wakeNextReadRef resets whenever requestIdentity changes, including when a background review poll returns a new headSha. If that response arrives after the user stops the distro, the next checks read sends wakeWslDistro: true for GitHub or omits background for GitLab. That starts the distro again without another click.
Keep resetting the request state when the head changes, but grant wake permission only when the user opens the panel, switches workspaces, or explicitly refreshes it.
The reason will be displayed to describe this comment to others. Learn more.
Tasks refreshes restart stopped distros
With one selected repo, every run of this effect sends wakeWslDistro: true, not just opening Tasks. The effect also runs when the global workItemsInvalidationNonce changes, including when another repo's cached items are removed. That refresh can start the selected repo's stopped distro through the list or count request.
Track the opening action separately and leave later automatic refreshes background-only.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
set -eu
printf'%s\n''--- prefetch implementation ---'
sed -n '1,240p' src/main/worktree-create-base-prefetch.ts
printf'%s\n''--- checkout preparation ---'
sed -n '1,260p' src/main/worktree-create-preparation.ts
printf'%s\n''--- worktree-root preparation ---'
sed -n '1,180p' src/main/worktree-root-preparation.ts
printf'%s\n''--- WSL gate ---'
sed -n '1,180p' src/main/wsl/wsl-unc-access-gate.ts
printf'%s\n''--- related root/settings symbols ---'
rg -n -F --glob '*.ts' -e 'worktreeBasePath' -e 'workspaceDir' -e 'getWorktreeMirrorDistro' -e 'prepareLocalWorktreeRootForRepo' src/main src/renderer ||test"$?" -eq 1
Repository: stablyai/orca
Length of output: 41428
Script executed:
set -eu
printf'%s\n''--- preparation pool definitions ---'
rg -n -F --glob '*.ts' -e 'export async function startPreparation' -e 'function startPreparation' -e 'workspaceRoot' src/main/worktree-create-preparation-pool.ts src/main/worktree-create-preparation*.ts src/main/git
printf'%s\n''--- preparation pool ---'
sed -n '1,280p' src/main/worktree-create-preparation-pool.ts
printf'%s\n''--- preparation worker and filesystem operations ---'
rg -n -F --glob '*.ts' -e 'startPreparation(' -e 'mkdir(' -e 'workspaceRoot' src/main/worktree-create-preparation.ts src/main/git/worktree-create-preparation.ts
sed -n '1,260p' src/main/git/worktree-create-preparation.ts
Repository: stablyai/orca
Length of output: 28069
Script executed:
set -eu
printf'%s\n''--- worktree root resolution ---'
sed -n '100,295p' src/main/ipc/worktree-logic.ts
printf'%s\n''--- host filesystem path conversion ---'
rg -n -F --glob '*.ts' -e 'export function toHostFilesystemPath' -e 'function toHostFilesystemPath' src/main
sed -n '1,180p' src/main/host-tree-removal.ts
printf'%s\n''--- exact preparation block ---'
nl -ba src/main/worktree-create-preparation-pool.ts | sed -n '205,255p'printf'%s\n''--- exact WSL gate contract ---'
nl -ba src/main/wsl/wsl-unc-access-gate.ts | sed -n '15,95p'
Repository: stablyai/orca
Length of output: 17467
Check the worktree root before speculative preparation.
prefetchWorktreeCreateBase invokes prepareWorktreeCreateForRepo, which computes the settings-derived workspaceRoot and starts preparation for that root. The prefetch handler checks only repo.path and gitOptions.wslDistro. A WSL UNC worktreeBasePath or workspaceDir can remain unchecked, and mkdir can start its stopped distro. Check the resolved worktree root before starting speculative preparation, including when its distro differs from the Git distro.
Gate the destination root as well as the repo path.
An explicit WSL UNC workspaceDir or worktreeBasePath is a supported destination. The current gate checks only repo.path, so it can miss the destination distro. prepareLocalWorktreeRootForRepo can then call mkdir on the UNC root while the distro is stopped. A WSL UNC filesystem touch can start that distro.
This behavior existed before this PR, but the new gate does not cover it. The PR still fails to prevent this background settings-preparation path. Check the effective destination before calling mkdir.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n 1,130p src/renderer/src/components/right-sidebar/checks-panel/use-checks-detail-timer.ts
Repository: stablyai/orca
Length of output: 4799
Script executed:
sed -n '120,280p' src/renderer/src/components/right-sidebar/checks-panel/use-checks-detail-timer.ts
printf'\n--- poller references and implementation ---\n'
rg -n -F --glob '*.ts' -e 'export function installWindowVisibilityTimeoutPoller' -e 'function installWindowVisibilityTimeoutPoller' src/renderer/src
poller=$(rg -l -F --glob '*.ts' -e 'export function installWindowVisibilityTimeoutPoller' -e 'function installWindowVisibilityTimeoutPoller' src/renderer/src | head -n 1)if [ -n"$poller" ];thenprintf'\n--- %s ---\n'"$poller"
sed -n '1,260p'"$poller"fi
Repository: stablyai/orca
Length of output: 4988
Do not retain wake permission for a later poll.
When the panel reopens before nextAttemptAtRef, the poller's immediate read returns at the cooldown check. The code consumes wakeNextReadRef only after that check. The poller then schedules another read, which can call fetchChecks with wakeWslDistro: true.
Consume the permission before the cooldown return.
When a stopped WSL distro refuses a background poll, return the preserved cached review without logging the recognized refusal. Continue logging other failures.
Suggested fix
+import { isWslDistroNotRunningRefusal } from '../../../../shared/wsl-distro-not-running-refusal'+
...
- console.error('Failed to fetch hosted review:', error)+ if (!isWslDistroNotRunningRefusal(error)) {+ console.error('Failed to fetch hosted review:', error)+ }
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: 41b7800f-fd35-4a5e-b845-b5f126ccc435
Commits
Reviewing files that changed from the base of the PR and between de2f9db and 8859b31.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
… distro
Git history, diff and status-follower reads, GitHub issue/work-item/check
polls, chat link existence checks, the composer's create-base prefetch,
the worktree-root fan-out and the Settings/Automations orca.yaml previews
now refuse or skip a stopped WSL distro instead of starting it (E9).
… (E9)
Folds the parallel G1-G6 work into this branch and splits background
reads from user acts:
- An explicit open runs as a user act for its distro and may boot it:
showing a diff tab or its Retry, showing Commits or its Refresh,
opening the checks panel or entering its tab, checks Refresh, a check
action, and linking or creating a PR. Main takes a wakeWslDistro flag
on git:diff, git:branchDiff, git:commitDiff, git:history and
gh:prChecks and runs those reads under runAsWslUserAct.
- Polls, timers, refreshes after Git actions, prefetches and fan-outs
stay background and are refused while the distro is stopped.
- Also gated: the hosted-review card poll for every provider, the GitLab
checks-panel poll (background flag), and the composer's open-time
orca.yaml check (Create re-checks in the foreground).
- Pollers keep the data they already show on a refusal: the issue on a
card, the checks list, an open diff and loaded submodule children, and
stop logging it.
… link-check gating (E9)
- Link existence checks (shell:pathsExist / pathExists) are no longer
gated here: answering "missing" cached chat and terminal links as
absent and toasted "File not found" on markdown link clicks. The
pathsExist refusal lives in its own PR, which throws instead.
- Settings no longer sits on "checking" forever: a repo whose distro
refused the background check is re-asked on window focus, on
visibility, and after 10 s, until it answers. An unverifiable distro is
now marked (wsl-distro-unverifiable) and treated as unread too, instead
of being stored as "no orca.yaml".
- The sidebar issue poll and the Tasks list and count refuse with "Open a
terminal in it to start it", since their Retry is itself a background
read; the checks panel keeps "Retry", whose Refresh is a user act.
…kups may start a stopped distro (E9)
- Tasks: a Refresh, Retry or search, or Tasks opened on a single repo,
passes wakeWslDistro through gh:listWorkItems and gh:countWorkItems
(IPC only; the RPC twins and web routes drop it). A multi-repo open
stays background. Their refusal says "Retry" again; only the sidebar
issue poll says "Open a terminal".
- hostedReview:forBranch wakes for an interactive request (the checks
panel's manual Refresh), so GitLab, Bitbucket, Azure DevOps and Gitea
reviews with nothing cached can load.
- gh:prForBranch, the renderer's fallback when refreshPRNow is missing,
is gated like the other card polls; a manual lookup wakes, matching
refreshPRNow's manual-only rule. The fallback call moves into its own
module, built from the refresh candidate.
… status (E9)
hostedReview:forBranch woke on admissionTier 'interactive', but the
visible-review scheduler sends 'interactive' for the selected card on a
timer, so that poll restarted a stopped distro every interval. The wake
is now an explicit wakeWslDistro flag (desktop IPC only). The card
refresh helper sets it, since every caller follows a user act (the
checks panel's manual Refresh, or a review created, linked or edited),
and the manual Refresh also wakes its pre-refresh git status.
admissionTier is back to priority only.
fetchHostedReviewForBranch let a forced card Refresh join an in-flight
forced scheduler poll, since the join only compared force. On a stopped
WSL distro that poll is refused, so the click got the refusal. The
in-flight entry now records the wake, and a waking request joins only a
waking flight; a poll may still join an explicit Refresh.
The reason will be displayed to describe this comment to others. Learn more.
Commits restarts stopped distros
useSourceControlGitHistory grants wake permission whenever compareBaseRef changes, not just when the user opens Commits. A review poll started before the distro stops can return afterward with a changed PR target branch. That changes compareBaseRef and starts the stopped distro through git:history, without another click.
Keep the automatic refresh, but grant wake permission only for opening Commits, switching workspaces, or pressing Refresh.
The reason will be displayed to describe this comment to others. Learn more.
Typed searches cannot start distros
Typing a search on multi-repo Tasks does not get wake permission. The search applies automatically after 750 ms, but commitTaskSearch only updates appliedTaskSearch; it does not change taskRefreshNonce. This condition therefore sends no wake flag, and the new main-process guard refuses reads from stopped distros.
Track an applied user search separately from opening the multi-repo page so typing works without an extra Enter or Retry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
If you stop a WSL distro, Orca should leave it stopped until you do something in it. Several background readers kept starting it again on their own: the Git and GitHub/GitLab polls, and checks that run when a page opens. Now they wait. Opening something yourself (a diff, the Commits list, the checks panel) still starts the distro, because that's you asking for it.
What Changed
Before: after
wsl --terminate, these reads could start the distro again within seconds, with no click:After: each read checks the existing settled gate first (
assertWslUncPathRunning/blockedWslDistroForPath, with a 60 s lease), and covers the project's distro, not only\\wsl.localhostpaths. What happens next depends on who asked.Background reads are refused while the distro is stopped. These are polls, timers, refreshes after a Git action, prefetches and fan-outs.
gh:prForBranch(the card fallback when the refresh coordinator is absent) is gated like the other card polls.Explicit opens are user acts and may boot the distro. Each one runs under
runAsWslUserActfor that distro, via awakeWslDistroflag ongit:diff,git:branchDiff,git:commitDiff,git:historyandgh:prChecks:gh:listWorkItems/gh:countWorkItems; a multi-repo open stays background);hostedReview:forBranchwithwakeWslDistro, set by the checks panel's manual Refresh and by the refresh that follows a review the user created, linked or edited), so GitLab, Bitbucket, Azure DevOps and Gitea reviews with nothing cached can load.admissionTierstays priority only: the visible scheduler sends'interactive'for the selected card on a timer, and that poll is refused;gh:prForBranch.User acts that already started a distro are unchanged: opening a terminal, the active workspace's first status read, expanding the explorer, creating a worktree, and fetching.
Why
This is the GitHub and Git reader group (G1, G2, G4–G6, G8) from the E9 background-boot audit. Link existence checks (G3) are in #35412, which throws a refusal instead of answering "missing".
Gating in the main-process handler covers every caller, including renderer retries, timers and the web client. It copies the
git:statuspattern: gated by default, with a wake flag only where the user explicitly opened the thing. A new caller is safe without having to remember a flag.backgroundflag instead of a wake flag because most callers are explicit dialog opens.Linked Issue
N/A (internal WSL rewrite, E9 audit follow-up)
Visual Proof
N/A: no new UI. A stopped distro now shows the last data, the existing stopped-distro error, or the existing "checking" state, instead of booting.
Testing
New tests, each confirmed to fail with its source change reverted:
filesystem-wsl-stopped-distro-git.test.ts:github-wsl-stopped-distro.test.ts:gh:issue,gh:listWorkItems,gh:countWorkItemsandgh:prChecksrefuse without running gh;gh:prChecks,gh:listWorkItems,gh:countWorkItemsandgh:prForBranch, a user act may start the distro but the next poll may not;hosted-review.test.tsandgitlab.test.ts: the card poll, the interactive-priority scheduler poll and the GitLab checks poll refuse; an explicit review Refresh and an explicit GitLab open read.visible-hosted-review-refresh-targets.test.ts: the scheduler's refresh of the selected card sends no wake; a card refresh does.use-checks-panel-polling.test.tsx: the read that opens the panel wakes, later polls don't, and reopening wakes again (GitHub and GitLab).use-git-history-wsl-wake.test.tsx: showing Commits and its Refresh wake; a ref-driven refresh doesn't.wsl-stopped-distro-poll-refusal.test.ts:worktrees-wsl-runtime-routing.test.ts,worktree-root-preparation.test.ts,use-automations-page-setup-state.test.tsx: prefetch, G8, and the Automations background/foreground split.use-settings-repo-scroll-effects.test.tsx: Settings asks in the background, stays "checking" for a stopped or unverifiable distro, and records it once a focus or the 10 s retry finds it running.worktree-hook-check-background-gate.test.ts: an unverifiable distro is marked unread.github-wsl-stopped-distro.test.tsalso checks the refusal wording per surface.wsl-unc-access-gate.test.ts: the refusal is recognised in-process, over IPC and over RPC.Also run:
pnpm tc,pnpm run typecheck:ci,pnpm run check:code-quality:changed, the anti-slop lint, ast-grep, and the suites related to the changed files. Not run on Windows.Flag-off: these paths don't check the WSL hosts flag, so the gate applies flag-off too. That's the point: the boots happened flag-off. With a running distro, behaviour is unchanged, apart from at most one shared
wsl --list --runningper minute.User-risk: low. Background panels keep their last data while the distro is stopped, and anything the user opens explicitly starts it as before.
console.error. A filter would pushhosted-review.tsover the 300-line limit. The cached review is kept.AI Disclosure
Review
Agent skill upstream boundary
Notes
wakeWslDistroandbackgroundhints. IPC args gain optional fields only.Status
Ready for review. This folds in the parallel #35429, which will be closed. Not merged.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)