Repository navigation
Conversation
… WSL distro (E9) gh, glab and git run for a WSL repo go through wsl.exe in its distro, so any background read boots a stopped one. These polls ran ungated: - the sidebar's linked-issue (gh:issue) and hosted-review card polls - the checks panel (gh:prChecks, GitLab MR details) every 60-120 s - git status followers: history, submodule status, ignored paths, the huge-folder probe and diff reloads - page-open fan-outs: Tasks list/count, Settings and Automations orca.yaml checks, the composer's hook check and speculative create prefetch Each now asks the settled running gate first and refuses (or skips) while the distro is stopped. Pollers keep the data they already show. User acts still start the distro: showing a diff tab or its Retry, the checks and Commits Refresh buttons, a check action, and creating the workspace or saving the automation.
[Medium impact] The changes affect background reads across several WSL-backed repository views and tasks. The PR appears safe to merge, with a non-blocking gap when reopening an already-active diff. Findings
SummaryAdds main-process guards so Git and forge followers leave stopped WSL distros alone.
Acknowledged by
Reviews (1) · Last reviewed commit: "fix(wsl): GitHub, GitLab and Git followe..." · Reviewed by Greptile |
| } else if (isReloadableSingleFileDiffTab(fileToLoad) && needsDiffRead(fileToLoad.id)) { | ||
| void loadDiffContent(fileToLoad) | ||
| void loadDiffContent(fileToLoad, load) |
There was a problem hiding this comment.
Clicking a source-control file whose diff is already active does not refresh it when WSL is stopped. openDiff keeps the tab ID and bumps diffContentReloadNonce, but that reload sends only force: true. The new gate refuses the read, and the catch silently keeps the old diff.
Pass wakeWslDistro: true through this explicit reopen path while keeping automatic reloads non-waking.
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 3

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:
3652df56-b970-4963-a03e-569be8f48008
Files selected for processing: 55-
src/main/ipc/filesystem/filesystem-git-diff-handlers.tssrc/main/ipc/filesystem/filesystem-git-status-handlers.tssrc/main/ipc/filesystem/filesystem-wsl-stopped-distro-git.test.tssrc/main/ipc/filesystem/wsl-gated-worktree-git-read.tssrc/main/ipc/github-pr-read-handlers.tssrc/main/ipc/github-repo-routing.tssrc/main/ipc/github-work-item-handlers.tssrc/main/ipc/github-wsl-runtime-routing.test.tssrc/main/ipc/github-wsl-stopped-distro-reads.test.tssrc/main/ipc/gitlab-work-item-handlers.tssrc/main/ipc/gitlab.test.tssrc/main/ipc/hosted-review.test.tssrc/main/ipc/hosted-review.tssrc/main/worktree-create-base-prefetch.test.tssrc/main/worktree-create-base-prefetch.tssrc/main/wsl/wsl-unc-access-gate.test.tssrc/main/wsl/wsl-unc-access-gate.tssrc/preload/api/gh-bridge-pull-requests-and-work-items.tssrc/preload/api/git-bridge.tssrc/preload/api/git-inspection-api.tssrc/preload/api/github-pull-request-api.tssrc/preload/api/gitlab-api.tssrc/preload/gitlab.tssrc/renderer/src/components/automations/use-automation-draft-effects.tssrc/renderer/src/components/automations/use-automations-page-setup-state.tssrc/renderer/src/components/editor/useEditorPanelActiveTabContentLoad.tssrc/renderer/src/components/editor/useEditorPanelContentState.test.tsxsrc/renderer/src/components/editor/useEditorPanelContentState.tssrc/renderer/src/components/editor/useEditorPanelDiffContentLoader.tssrc/renderer/src/components/github-item-dialog/inspect-pull-request/checks-tab-actions.tssrc/renderer/src/components/pull-request-page/checks/refresh.tssrc/renderer/src/components/right-sidebar/checks-panel/gitlab-review-client.tssrc/renderer/src/components/right-sidebar/checks-panel/use-checks-detail-timer.tssrc/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-check-and-review-actions.tsxsrc/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-entry-refresh-and-title-actions.tsxsrc/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-manual-refresh.tsxsrc/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-polling.tsxsrc/renderer/src/components/right-sidebar/source-control/listing/use-submodule-status.tssrc/renderer/src/components/right-sidebar/source-control/panel/panel-content.tsxsrc/renderer/src/components/right-sidebar/source-control/sync/use-git-history.tssrc/renderer/src/components/right-sidebar/source-control/sync/use-status-refresh.tssrc/renderer/src/components/settings/use-settings-repo-scroll-effects.tssrc/renderer/src/hooks/composer-state/host-runtime-effects.tssrc/renderer/src/hooks/composer-state/provider-runtime-sync.tssrc/renderer/src/hooks/composer-state/provider-sync-model.tssrc/renderer/src/runtime/runtime-git-diff-client.tssrc/renderer/src/runtime/runtime-git-status-client.tssrc/renderer/src/runtime/runtime-gitlab-api.tssrc/renderer/src/store/github/check-actions.tssrc/renderer/src/store/github/issue-actions.tssrc/renderer/src/store/github/request-coordination.tssrc/renderer/src/store/github/slice-types.tssrc/renderer/src/store/github/wsl-stopped-distro-poll-refusal.test.tssrc/renderer/src/web/preload-api/web-github-api.tssrc/shared/wsl-distro-not-running-refusal.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
| localGitExecOptions: localGitOptions | ||
| }) | ||
| // Sidebar cards and the checks panel poll this for every provider; gh/glab in WSL boot it (E9). | ||
| const review = await guardWslUncPathAccess( |
There was a problem hiding this comment.
Allow explicit hosted-review refreshes to wake WSL.
If the preceding Git-status read is skipped or fails, a checks-panel Refresh reaches this gate with admissionTier: 'interactive' while the distro is still stopped. The gate has no wake option here, so it rejects before getHostedReviewForBranch runs. Pass wake for the explicit interactive request; keep automatic lookups non-waking. (raw.githubusercontent.com)
Proposed change
-
- { wslDistro: localGitOptions.wslDistro } + { + wslDistro: localGitOptions.wslDistro, + wake: localGitOptions.admissionTier === 'interactive' + }
| if (!liveRepoHostIdentities.has(repoHostIdentity)) { | ||
| return previous | ||
| } | ||
| if (result.unavailable === 'wsl-distro-stopped' && previous[repoHostIdentity]) { |
There was a problem hiding this comment.
Preserve existing hooks for unverifiable WSL checks.
When WSL cannot report the distro state, the handler returns status: 'error' without unavailable. This condition then allows the error result to replace existing hooks with hasHooks: false. Preserve the existing entry for error results as well.
| void loadHookCheckForRepo(repoId, { background: true }) | ||
| .then((result) => { | ||
| if (!cancelled) { | ||
| if (!cancelled && result.unavailable !== 'wsl-distro-stopped') { |
There was a problem hiding this comment.
Do not mark failed hook checks as complete.
When the WSL running check is unverifiable, the handler returns an error without the stopped marker. This condition commits null and marks the context as checked. For an ask policy with YAML-only setup, quick submission then skips its foreground check and proceeds without showing the setup choice. Ignore error results so submission can retry the check. (raw.githubusercontent.com)
ELI5
When a WSL distro is stopped, Orca must not start it unless you ask for it. The GitHub, GitLab and Git readers in the sidebar, the checks panel and some pages kept re-reading it on a timer, and every read woke the distro back up. Now those timers skip a stopped distro and keep showing what they already had. Clicking something (opening a diff, pressing Refresh) still starts it.
What Changed
Before: with a repo in WSL and the distro stopped (for example
wsl --terminate), the distro came back within minutes without the user doing anything. Each of these rangh,glaborgitthroughwsl.exe -d <distro>, or touched\\wsl.localhost\<distro>:gh:issue, 5 min per card) and hosted-review card poll (hostedReview:forBranch, all providers, including GitLab)gh:prChecksevery 60–120 s, and GitLab MR details (gitlab:workItemDetails) from the same timergit:history,git:submoduleStatus,git:checkIgnored,git:findHugeFoldersToIgnore, and diff reloads (git:diff,git:branchDiff,git:commitDiff)gh:listWorkItems,gh:countWorkItems), the Settings and Automationsorca.yamlchecks, the composer's open-time hook check, and the speculative create-base prefetch (composer and palette)After: each one asks the existing settled "is this distro running" check first. That is the same check the desktop
git:statushandler already uses (assertWslUncPathRunning/blockedWslDistroForPath, throughguardWslUncPathAccess). If the distro is stopped, or WSL doesn't answer, the read is refused, or skipped in the prefetch's case, before anything runs in the distro. On the renderer side, pollers treat that refusal as "keep the last data":What still counts as a user act and may start the distro:
wakeWslDistroand now reach the diff handlers)The refusal text lives in
src/shared/wsl-distro-not-running-refusal.ts, so the renderer can recognise it after IPC wraps it.Why
This copies the pattern already used for
git:status: gate by default, and let awakeWslDistroflag mark a user act. New background callers are safe without anyone having to remember a flag. I used abackgroundflag instead (thehooks:checkpattern) only where most callers are explicit opens:gitlab:workItemDetails(dialogs) and the hook checks. Gating in main, not only in the renderer, also covers the web client and any future caller.Linked Issue
N/A (internal WSL E9 audit, PR 3 of the plan: items G1, G2, G4–G6).
Visual Proof
N/A. With the distro running nothing changes on screen. With it stopped, the visible difference is that panels keep their last data instead of the distro booting. This needs a Windows machine with WSL and can't be shown from the macOS dev box this was built on.
Testing
New
github-wsl-stopped-distro-reads.test.ts:gh:issue,gh:prChecks,gh:listWorkItemsandgh:countWorkItemsrefuse without running gh; a checks Refresh starts the distro but the next poll doesn't; running and Windows-host repos behave as before.filesystem-wsl-stopped-distro-git.test.ts: the seven follower channels refuse before path resolution or Git; showing a diff tab may start the distro but a reload may not.hosted-review.test.ts,gitlab.test.ts,worktree-create-base-prefetch.test.ts: the card poll, the GitLab checks poll and the prefetch skip a stopped distro; an explicit GitLab open still reads.wsl-stopped-distro-poll-refusal.test.ts(renderer): a refused issue poll keeps the cached issue and doesn't log; refused checks are served from cache quietly; Refresh sends the wake flag and doesn't join an in-flight poll.wsl-unc-access-gate.test.ts: the refusal is recognised in process, over IPC and over RPC.Every new test fails with the fix reverted (16 main and 3 renderer cases).
pnpm tc,pnpm run typecheck:ci,pnpm run check:code-quality:changed, the anti-slop oxlint and ast-grep pass on the changed files.The suites related to the changed files pass, except 9 files that fail identically without this change (real-Git, real-watcher and cross-version-wire suites in this environment).
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Flag-off: these paths do not check
ORCA_INTERNAL_WSL_HOSTS, so the change ships to everyone with WSL-runtime repos. Behaviour with a running distro is unchanged, apart from at most one extrawsl --list --runningper minute, shared with the existing status gate.User-risk:
console.error, because adding the filter would pushhosted-review.tsover the 300-line limit. The cached review is still preserved.Agent skill upstream boundary
Notes
wakeWslDistroandbackgroundhints before calling a host.Status
Ready for review. Not merged.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)