Skip to content

fix(wsl): user clicks on cwd-less gh may start the stopped default distro - #36230

Merged
nwparker merged 3 commits into
mainfrom
nwparker/gh-glab-user-click-wsl-act
Oct 30, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/gh-glab-user-click-wsl-act

Conversation

@nwparker

@nwparker nwparker commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​278 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​276
Prod 19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​149 $\color{#cf222e}{\Huge{\mathbf{−}}}$​68 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​81

ELI5

#35709 stopped background GitHub and GitLab work from silently starting a stopped WSL distro on Windows. That also blocked explicit clicks for people whose gh exists only in WSL: starring Orca, the GitHub sign-in diagnosis, picking a project board, opening a board item, or editing one now got a "not running" error, where they used to start WSL and work. Clicks are allowed to start the distro, so this lets them again. It also stops the GitHub and GitLab rate-limit cards from flipping to "unavailable" every time the distro is stopped; they keep the last numbers they had.

What Changed

  • Before:
    • With gh only in WSL and the default distro stopped, these clicks failed with "WSL distro '…' is not running": Star (it silently fell back to the browser), the project picker, opening a work item, and board edits.
    • The rate-limit cards showed "API budget is unavailable" on every poll while the distro was stopped.
  • After:
    • Those clicks may start the distro, as E9 allows for user actions.
    • Loads that run with no click still never start it: a restored Projects page listing its board's views from a mount effect, and the auth diagnosis that renders with an auth error.
    • The rate-limit cards keep their last snapshot on the not-running refusal. With no snapshot yet, they still say unavailable instead of showing "Loading…" forever.

Mechanism:

  • A click marks itself. The project-view IPC args gain an optional wakeWslDistro (WakeWslDistroArg). The main handlers run the call as a user act on the fallback's distro (runAsDefaultWslCliUserAct, which honours the configured override) only when it's true.
  • Who sets it: the renderer sets it at click sites only:
    • Picker: browse runs when the user opens it; choosing a project lists its views; pasting a URL resolves it.
    • Opening a work item.
    • Every edit: field set and clear, issue and PR updates, issue type, and comment add, edit and delete, wherever they're issued.
  • Who doesn't: useProjectViewTable's mount effect, the board table, and the label, assignee and issue-type lists leave it unset. gh:diagnoseAuth never wakes, because GhAuthErrorHelp calls it from a mount effect.
  • Star: starOrca runs as a user act itself. Its only callers are the Star buttons, with no mount-effect caller.
  • Rate-limit cards: useGitHubRateLimitSnapshot and useGitLabRateLimitSnapshot treat isWslDistroNotRunningRefusal, returned or thrown, as "keep the last data" when there is one, like the checks and status pollers.
  • Wire safety: the flag is set only on the local IPC path. The project RPC schemas are plain z.object, so the web client's routed calls, and older hosts, drop it.

Why

Linked Issue

N/A (review follow-up to #35709).

Visual Proof

N/A: no layout change. The rate-limit cards keep showing their last numbers instead of the unavailable line while the distro is stopped.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
Test What it checks Without the change
github-click-wsl-user-act.test.ts Each of the 12 project-view click channels runs as a user act with wakeWslDistro, and stays gated without it. The table, the label/assignee/issue-type lists and gh:diagnoseAuth never wake, even when asked. The click cases fail
project-view-mount-no-wake.test.tsx useProjectViewTable's mount effect calls listProjectViews without wakeWslDistro; a picker click passes it. Fails if the mount effect passes wake (mutation-checked)
default-wsl-cli-fallback-gate.test.ts starOrca with a stopped default distro and host gh missing starts WSL and succeeds. Fails
code-host-rate-limit-stopped-wsl.test.tsx (GitHub and GitLab) Refusals keep the last snapshot; with no snapshot yet, it reports unavailable; other errors still report. The keep cases fail

github-work-item-issue-target.test.ts's exact-argument assertions now include wakeWslDistro: true for edits. The 42 related test files pass (278 tests). pnpm tc, pnpm run typecheck:ci, check:code-quality:changed, the anti-slop oxlint, and ast-grep pass. Run on macOS with the Windows platform simulated.

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

  • Cross-platform: Windows only. Off Windows, the user act names no distro and just runs the function.
  • SSH: unaffected.
  • Providers: GitHub and GitLab rate-limit cards alike.

Flag-off: no flag; it affects Windows users whose gh exists only in WSL when the default distro is stopped.
User-risk: low. Those clicks work again by starting the distro, as they did before #35709, and the rate-limit cards stop flickering to "unavailable".

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)

…stro

#35709 stopped background gh/glab from booting a stopped default distro,
which also refused explicit clicks for users whose gh lives only in WSL.
Starring Orca, the auth diagnosis, the project picker, opening a work
item and board edits now run as a user act on the distro the fallback
uses; the board table reload, which also runs unprompted, stays gated.
The GitHub and GitLab rate-limit cards keep their last snapshot on the
not-running refusal instead of flipping to unavailable.
@nwparker

Copy link
Copy Markdown
Contributor Author

STATUS: ready for review at 3c33bcf. #35709 follow-up: cwd-less gh clicks run as a default-distro user act, and the rate-limit cards keep their last snapshot while the distro is stopped. Every new test fails without its change; 120 related test files and local gates pass.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 5c1cfe21-095f-46b8-9ca9-de9d2347794a
Commits

Reviewing files that changed from the base of the PR and between 17828c7 and e23b384.

Files selected for processing: 24
  • src/main/git/command-runner/default-wsl-cli-fallback.ts
  • src/main/git/command-runner/wsl-command-resolution.ts
  • src/main/git/default-wsl-cli-fallback-gate.test.ts
  • src/main/github/client/fetch/orca-star.ts
  • src/main/ipc/github-click-wsl-user-act.test.ts
  • src/main/ipc/github-project-view-handlers.ts
  • src/renderer/src/components/github-project/ProjectPicker.tsx
  • src/renderer/src/components/github-project/project-picker-runtime.ts
  • src/renderer/src/components/github-project/project-view-mount-no-wake.test.tsx
  • src/renderer/src/components/github-project/slug-dialog/Comments.tsx
  • src/renderer/src/components/github-project/slug-dialog/SlugDialogBody.tsx
  • src/renderer/src/components/github-project/useProjectPickerBrowse.ts
  • src/renderer/src/components/github-project/useProjectViewTable.ts
  • src/renderer/src/components/github/code-host-rate-limit-stopped-wsl.test.tsx
  • src/renderer/src/components/github/github-rate-limit-display.tsx
  • src/renderer/src/components/github/github-work-item-edit-mutations.ts
  • src/renderer/src/components/github/github-work-item-issue-target.test.ts
  • src/renderer/src/components/gitlab/gitlab-rate-limit-display.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-comment-mutations.tsx
  • src/renderer/src/components/task-page/github/AssigneesCell.tsx
  • src/renderer/src/components/task-page/github/StatusCell.tsx
  • src/renderer/src/store/github/project-field-mutations.ts
  • src/renderer/src/store/github/project-row-actions.ts
  • src/shared/github/project-request-types.ts
  • 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.

…ject gh calls

Wrapping the project-view and auth-diagnosis IPC handlers as user acts
also let mount effects (useProjectViewTable listing a restored board's
views, GhAuthErrorHelp's diagnosis) start a stopped default distro. The
handlers now wake only when the renderer passes wakeWslDistro, which the
picker browse/select, opening an item and every edit set; mount effects
leave it unset, and the auth diagnosis never wakes.
@nwparker

Copy link
Copy Markdown
Contributor Author

STATUS: reworked at 519281b after review of 3c33bcf. Only an explicit click (wakeWslDistro from the click site) may start the distro. Mount effects stay gated, including useProjectViewTable's view list and GhAuthErrorHelp's diagnosis, with a mount-effect test. Local gates and the 42 related test files pass.

@nwparker
nwparker merged commit 58c50f2 into main Oct 30, 2026
63 of 64 checks passed
nwparker added a commit that referenced this pull request Nov 6, 2026
…zed error toasts (#39193)

Board drops send wakeWslDistro (#36230) and network failures toast localized
copy (#34621). Route GitHub Projects sources to the board spec so PRs run it.
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