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): Settings' issue-command and path checks never start a stopped distro - #35829
If you stop a WSL distro and then open Settings, Orca starts the distro again. The repository section reads the repo's issue-command files, and the MCP section checks that the repo folder exists. Both go through \\wsl.localhost, and on Windows any touch of that path starts a stopped distro. Now both leave a stopped distro alone. Launching work and clicking a link still start it, because those are the user's own actions.
What Changed
Issue-command read (hooks:readIssueCommand over IPC, and repo.issueCommandRead for paired clients):
Before: it always read .orca/issue-command and orca.yaml over \\wsl.localhost, including when the Settings repository section mounted.
After: it goes through a new readIssueCommandUnlessWslStopped. For a stopped (or unverifiable) distro it returns the same "unreachable" result the SSH branch already uses: status: 'error', no content, the real file path. It touches nothing.
Launch paths pass wakeWslDistro: true and run as a user act: ensureHooksConfirmed (launching work, automation save, workspace create/remove) and readAndConfirmRuntimeIssueCommand (workspace create). So a launch still starts the distro and reads the real command.
The RPC gets an optional wakeWslDistro, through a new RepoIssueCommandRead params schema. Older hosts drop the unknown key.
Issue-command editor (Settings):
A refused read used to show an empty, editable field. Typing then saved over the hidden local override and started the distro.
Now the field stays read-only, with "WSL distro is stopped. Open a terminal in it to see or edit this command." Both the blur save and the unmount save are skipped while the content is unknown.
The refused result names the distro in a new optional refusedWslDistro.
Issue-command write (hooks:writeIssueCommand and repo.issueCommandWrite):
Gated the same way unless the user is saving their own edit (wakeWslDistro, which the Settings editor passes).
Older clients that don't send it get a refusal instead of an overwrite on a stopped distro.
shell:pathExists:
Before: ungated. The Settings MCP section called it on the repo root when it mounted.
After: wrapped in guardWslUncPathAccess, the same check its batch sibling shell:pathsExist already uses. A refused check throws the "WSL distro … is not running" error, which the MCP section already shows through its catch.
Its stopped message says "Open a terminal in it to start it", not "Retry", because the section's retry is background too.
The two link-click callers pass wakeWslDistro: true: the Markdown preview's system open, and the rich editor's click routing.
Both path-existence handlers moved into shell-path-existence-handlers.ts.
Why
The real-WSL guard lane (#35590) attributed the stop-then-boot to exactly these touches. The main-process UNC log showed:
fs.existsSync …\repo\.orca\issue-command from hooks:readIssueCommand;
existsSync …\orca.yaml from the same read;
fs.promises.stat …\repo from shell:pathExists.
These came about 1.7 s after the stop was confirmed, during the Settings visit, and the distro was listed as running about 0.4 s later. Nothing else touched it before that.
Returning the existing unreachable shape reuses a state every caller already handles:
The Settings section shows an empty override and never writes unless the user edits.
ensureHooksConfirmed treats status: 'error' as "skip".
Gating at the handler covers every background caller at once. Marking only the known launch and click paths as user acts keeps those paths working.
Flag-off: bridge mode reads these files through \\wsl.localhost, which is the case fixed here. Host mode uses the same paths for these reads.
User-risk: while a distro is stopped, the Settings issue-command field is read-only with a note, and comes back by itself once the distro runs (on a paired client, on the next visit). The MCP section shows "WSL distro … is not running" until the distro runs. Launches, link clicks and saving your own edit still start the distro.
Linked Issue
Fixes #
Visual Proof
N/A. No new UI. A stopped distro shows the sections' existing empty and error states.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
A stopped distro returns the unreachable result without existsSync or the orca.yaml read.
A launch (wakeWslDistro) reads it.
Host repos and running distros read as before.
The runtime read is gated, and a launch's wake passes through.
shell-paths-exist-wsl-stopped-distro.test.ts: shell:pathExists refuses a stopped distro's path without a stat, answers host paths, and checks the path for a click.
repo.test.ts (RPC): wakeWslDistro: true reaches the read; a non-boolean value is dropped.
A refused read is read-only, and neither the commit nor the unmount ever writes.
The running signal re-reads the real command and removes the listener; edits then save with wakeWslDistro.
Unmounting stops the wait.
issue-command-wsl-running-signal.test.ts: a refused IPC read defers the running broadcast and an answered one doesn't; the write passes the user act through.
issue-command-wsl-stopped-distro.test.ts (write gate): a stopped distro refuses a write or clear without touching the file, and the user's own save writes.
rich-markdown-editor-click-routing.test.ts and a new markdown-preview-system-link-wsl-wake.test.ts: both clicks check with wakeWslDistro: true.
worktree-hook-execution-host.test.ts: host routing is unchanged.
Local checks: pnpm tc, typecheck:ci, check:code-quality:changed, anti-slop oxlint, and the RPC contract tests all pass. The real-WSL lane (#35590) re-runs on top of this.
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
Remote compatibility:
repo.issueCommandRead gains an optional boolean param; older hosts strip it.
The result gains an optional status: 'error' for the refused case. The IPC result already had status, and renderer types already allow it.
SSH: unchanged; SSH repos never reach the local read.
…ed distro
Opening the repository and MCP settings sections read .orca/issue-command,
orca.yaml and stat'ed the repo root over \\wsl.localhost, which starts a
stopped distro (E9). The issue-command read (IPC and runtime) now returns
the unreachable result for a stopped distro unless a launch passes
wakeWslDistro, and shell:pathExists is gated like shell:pathsExist, with the
two link-click callers passing wakeWslDistro.
Issue-command reads and writes now use WSL-aware access helpers. An optional wakeWslDistro flag passes through IPC, RPC, and renderer calls. Refused reads identify the stopped distro, and repository settings remain read-only while command content is unknown. Shell path-existence checks also support an optional wake flag. Markdown file-link actions request waking before checking local paths.
Priority: Normal
Merge Risk: Low · previous review 6d4c6
Some settings checks can fail silently or remain read-only, and an unchanged blur can start WSL. These issues have workarounds but warrant follow-up.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description covers the change, rationale, testing, compatibility, and checklist. However, the required Linked Issue section is incomplete because it contains only Fixes # without an issue number…
Add the actual linked issue number or URL after Fixes #. Also update the testing checklist to state whether the remaining required commands are covered by CI or have passed locally.
Docstring Coverage
Docstring coverage is 30.77% 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: 3 passed
Check name
Status
Explanation
Title check
The title clearly identifies the WSL fix and the affected Settings issue-command and path checks.
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 covers the change, rationale, testing, compatibility, and checklist. However, the required Linked Issue section is incomplete because it contains only Fixes # without an issue number or link.
Resolution
Add the actual linked issue number or URL after Fixes #. Also update the testing checklist to state whether the remaining required commands are covered by CI or have passed locally.
Full details: Docstring Coverage
Explanation
Docstring coverage is 30.77% 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 13 functions across 28 files. (10 skipped: 10 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Supported by static analysis
Script executed:
#!/bin/bash# Description: List callers of shell.pathExists and check each for rejection handling.
rg -nP --type=ts --type=tsx -C6 '\bshell\s*\.\s*pathExists\s*\(' src -g '!**/*.test.ts' -g '!**/*.test.tsx'
Handle rejected shell.pathExists promises at each direct caller.
McpConfigSection.loadConfigs already catches this rejection. TerminalPane.validateShell does not, and its onCommit handler discards the returned promise. The Markdown preview and rich-editor callers also use .then(...) without .catch(...).
A stopped or unverifiable WSL distro can make the guard reject. A failed wake can also reject. Add rejection handling that preserves the existing shell-validation state and reports link-click failures to the user.
A refused read showed an empty, editable field, and typing then saved over
the hidden local override and started the distro. The editor now stays
read-only with a stopped-distro note, skips both saves, and re-reads when
main signals the distro running. Writes are gated too unless the user is
saving their own edit (wakeWslDistro). The MCP section's stopped message no
longer offers a Retry that cannot start the distro.
…ore reading
Adds the note in every shipped locale, and attaches the editor's running
listener before its read so a distro that starts while the refused read is
in flight still triggers a re-read.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
#!/bin/bashset -e
nl -ba src/renderer/src/components/settings/repository/execution/RepositoryHooksSection.tsx | sed -n '1,240p'
Repository: stablyai/orca
Length of output: 10649
Limit the read-only state to refused WSL reads.
The SSH path returns status: 'error' without refusedWslDistro. The hook then makes the issue-command field read-only without a message or recovery listener. Enter this branch only when refusedWslDistro is present.
Proposed fix
--- "a/src/renderer/src/components/settings/use-repository-issue-command.ts"+++ "b/src/renderer/src/components/settings/use-repository-issue-command.ts"@@ -51,12 +51,12 @@
if (cancelled) {
return
}
- if (result.status === 'error') {- const stopped = result.refusedWslDistro ?? null+ const stopped = result.refusedWslDistro ?? null+ if (result.status === 'error' && stopped) {
setIssueCommandReadOnly(true)
setIssueCommandStoppedDistro(stopped)
const onDistroRunning = window.api.preflight?.onWslDistroRunning
- if (stopped && typeof onDistroRunning === 'function') {+ if (typeof onDistroRunning === 'function') {
// Main signals once the distro runs; read the real command then.
stopWaiting = onDistroRunning((distro) => {
if (distro.toLowerCase() === stopped.toLowerCase()) {
Skip wake-enabled writes when the command is unchanged.
After a successful read, focusing and blurring the textarea calls commitIssueCommand without an edit. If the distro stopped after that read, this write can start it despite no user change. Compare trimmed with lastCommittedIssueCommandRef.current before calling writeRuntimeIssueCommand. (raw.githubusercontent.com)
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: 5e1a9760-5676-4632-b9f4-bc47c202976d
Commits
Reviewing files that changed from the base of the PR and between 8865eef and 6d4c6c0.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
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 and then open Settings, Orca starts the distro again. The repository section reads the repo's issue-command files, and the MCP section checks that the repo folder exists. Both go through
\\wsl.localhost, and on Windows any touch of that path starts a stopped distro. Now both leave a stopped distro alone. Launching work and clicking a link still start it, because those are the user's own actions.What Changed
hooks:readIssueCommandover IPC, andrepo.issueCommandReadfor paired clients):.orca/issue-commandandorca.yamlover\\wsl.localhost, including when the Settings repository section mounted.readIssueCommandUnlessWslStopped. For a stopped (or unverifiable) distro it returns the same "unreachable" result the SSH branch already uses:status: 'error', no content, the real file path. It touches nothing.wakeWslDistro: trueand run as a user act:ensureHooksConfirmed(launching work, automation save, workspace create/remove) andreadAndConfirmRuntimeIssueCommand(workspace create). So a launch still starts the distro and reads the real command.wakeWslDistro, through a newRepoIssueCommandReadparams schema. Older hosts drop the unknown key.preflight:wslDistroRunningbroadcast (fix(wsl): don't start a stopped distro to read a repo's default base ref #35778'sbroadcastWhenWslDistroRunning), and the editor re-reads on it.refusedWslDistro.hooks:writeIssueCommandandrepo.issueCommandWrite):wakeWslDistro, which the Settings editor passes).shell:pathExists:guardWslUncPathAccess, the same check its batch siblingshell:pathsExistalready uses. A refused check throws the "WSL distro … is not running" error, which the MCP section already shows through its catch.wakeWslDistro: true: the Markdown preview's system open, and the rich editor's click routing.shell-path-existence-handlers.ts.Why
The real-WSL guard lane (#35590) attributed the stop-then-boot to exactly these touches. The main-process UNC log showed:
fs.existsSync …\repo\.orca\issue-commandfromhooks:readIssueCommand;existsSync …\orca.yamlfrom the same read;fs.promises.stat …\repofromshell:pathExists.These came about 1.7 s after the stop was confirmed, during the Settings visit, and the distro was listed as running about 0.4 s later. Nothing else touched it before that.
Returning the existing unreachable shape reuses a state every caller already handles:
ensureHooksConfirmedtreatsstatus: 'error'as "skip".Gating at the handler covers every background caller at once. Marking only the known launch and click paths as user acts keeps those paths working.
Flag-off: bridge mode reads these files through
\\wsl.localhost, which is the case fixed here. Host mode uses the same paths for these reads.User-risk: while a distro is stopped, the Settings issue-command field is read-only with a note, and comes back by itself once the distro runs (on a paired client, on the next visit). The MCP section shows "WSL distro … is not running" until the distro runs. Launches, link clicks and saving your own edit still start the distro.
Linked Issue
Fixes #
Visual Proof
N/A. No new UI. A stopped distro shows the sections' existing empty and error states.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
src/main/issue-command-wsl-stopped-distro.test.ts:existsSyncor theorca.yamlread.wakeWslDistro) reads it.shell-paths-exist-wsl-stopped-distro.test.ts:shell:pathExistsrefuses a stopped distro's path without a stat, answers host paths, and checks the path for a click.repo.test.ts(RPC):wakeWslDistro: truereaches the read; a non-boolean value is dropped.ensure-hooks-confirmed.test.ts: launch reads carrywakeWslDistro: true.use-repository-issue-command-wsl-stopped.test.ts:wakeWslDistro.issue-command-wsl-running-signal.test.ts: a refused IPC read defers the running broadcast and an answered one doesn't; the write passes the user act through.issue-command-wsl-stopped-distro.test.ts(write gate): a stopped distro refuses a write or clear without touching the file, and the user's own save writes.rich-markdown-editor-click-routing.test.tsand a newmarkdown-preview-system-link-wsl-wake.test.ts: both clicks check withwakeWslDistro: true.worktree-hook-execution-host.test.ts: host routing is unchanged.Local checks:
pnpm tc,typecheck:ci,check:code-quality:changed, anti-slop oxlint, and the RPC contract tests all pass. The real-WSL lane (#35590) re-runs on top of this.Review
Agent skill upstream boundary
Notes
repo.issueCommandReadgains an optional boolean param; older hosts strip it.status: 'error'for the refused case. The IPC result already hadstatus, and renderer types already allow it.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)