Skip to content

fix(wsl): Settings' issue-command and path checks never start a stopped distro - #35829

Merged
nwparker merged 4 commits into
mainfrom
nwparker/e9-issue-command-path-exists-gate
Oct 29, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/e9-issue-command-path-exists-gate

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​443 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​430
Prod 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​363 $\color{#cf222e}{\Huge{\mathbf{−}}}$​122 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​241

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

  • 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 IPC handler defers a preflight:wslDistroRunning broadcast (fix(wsl): don't start a stopped distro to read a repo's default base ref #35778's broadcastWhenWslDistroRunning), and the editor re-reads on it.
    • 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

  • src/main/issue-command-wsl-stopped-distro.test.ts:

    • 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.

  • ensure-hooks-confirmed.test.ts: launch reads carry wakeWslDistro: true.

  • use-repository-issue-command-wsl-stopped.test.ts:

    • 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.
  • Folder workspaces: unchanged; folder repos return early.

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)

…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.
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Settings reads and path checks now leave stopped WSL distros alone. Launches, link clicks, and user edits can still start them.

  • Issue-command reads leave stopped WSL distros alone unless a person starts the work.
  • Repository checks refuse stopped WSL paths while clicked links can wake them.

Reviews (4) · Last reviewed commit: "fix(wsl): keep the issue-command editor ..." · Reviewed by Greptile

Comment thread src/main/issue-command-file.ts Resolved
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 4 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: 79ed54c9-bf5a-4b64-bf2d-db19d383b64b
Commits

Reviewing files that changed from the base of the PR and between 6d4c6c0 and f7364b1.

Files selected for processing: 3
  • src/main/ipc/worktrees-issue-command-overrides.test.ts
  • src/main/runtime/runtime-repository-issue-command.test.ts
  • src/renderer/src/components/settings/use-repository-issue-command.ts
Walkthrough

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: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning 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 Warning 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 Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the WSL fix and the affected Settings issue-command and path checks.
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 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.

❤️ 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: 2b2797eb-8e0b-4a4a-93cb-198da2ac7be3
Commits

Reviewing files that changed from the base of the PR and between ab0e87c and 13efda8.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 23
  • src/main/ipc/hooks/register-worktree-hook-file-handlers.ts
  • src/main/ipc/hooks/worktree-hook-execution-host.test.ts
  • src/main/ipc/shell-path-existence-handlers.ts
  • src/main/ipc/shell-paths-exist-wsl-stopped-distro.test.ts
  • src/main/ipc/shell.ts
  • src/main/issue-command-file.ts
  • src/main/issue-command-wsl-stopped-distro.test.ts
  • src/main/runtime/rpc/methods/repo.test.ts
  • src/main/runtime/rpc/methods/repo.ts
  • src/main/runtime/runtime-repository-issue-command.ts
  • src/preload/api/agent-hook-api.ts
  • src/preload/api/hooks-bridge.ts
  • src/preload/api/shell-api.ts
  • src/preload/api/shell-bridge.ts
  • src/renderer/src/components/editor/markdown-preview-system-link-action.ts
  • src/renderer/src/components/editor/markdown-preview-system-link-wsl-wake.test.ts
  • src/renderer/src/components/editor/rich-markdown-editor-click-routing.test.ts
  • src/renderer/src/components/editor/rich-markdown-editor-click-routing.ts
  • src/renderer/src/lib/ensure-hooks-confirmed.test.ts
  • src/renderer/src/lib/ensure-hooks-confirmed.ts
  • src/renderer/src/runtime/runtime-hooks-client.ts
  • src/renderer/src/web/preload-api/web-review-api.ts
  • src/shared/rpc-contract/github-repo-target-params.ts

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

Comment on lines +31 to +35
async (_event, filePath: string, options?: { wakeWslDistro?: boolean }): Promise<boolean> =>
// Settings mounts ask unprompted, and a UNC stat boots a stopped distro (E9); clicks wake it.
guardWslUncPathAccess(filePath, () => pathExists(filePath), {
wake: options?.wakeWslDistro === true
})

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 · 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'

Repository: stablyai/orca

Length of output: 183


Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- direct shell.pathExists references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' --glob '!**/*.test.tsx' -- 'shell.pathExists' src || test "$?" -eq 1
printf '%s\n' '--- pathExists references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' --glob '!**/*.test.tsx' -- 'pathExists(' src || test "$?" -eq 1
printf '%s\n' '--- handler source ---'
sed -n '1,180p' src/main/ipc/shell-path-existence-handlers.ts
printf '%s\n' '--- IPC channel references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' --glob '!**/*.test.tsx' -e 'shell:pathExists' -e 'pathExists' src || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 17986


Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- McpConfigSection ---'
sed -n '130,195p' src/renderer/src/components/settings/McpConfigSection.tsx
printf '%s\n' '--- TerminalPane ---'
sed -n '55,120p' src/renderer/src/components/settings/TerminalPane.tsx
printf '%s\n' '--- terminal-path-existence-batch ---'
sed -n '1,145p' src/renderer/src/components/terminal-pane/terminal-path-existence-batch.ts
printf '%s\n' '--- markdown preview caller ---'
sed -n '35,95p' src/renderer/src/components/editor/markdown-preview-system-link-action.ts
printf '%s\n' '--- rich editor caller ---'
sed -n '215,270p' src/renderer/src/components/editor/rich-markdown-editor-click-routing.ts
printf '%s\n' '--- guard implementation ---'
rg -n -F --glob '*.ts' --glob '!**/*.test.ts' -e 'function guardWslUncPathAccess' -e 'assertWslUncPathRunning' src/main
sed -n '1,220p' src/main/wsl/wsl-unc-access-gate.ts

Repository: stablyai/orca

Length of output: 21100


Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- validateShell call sites ---'
rg -n -F --glob '*.tsx' --glob '!**/*.test.tsx' -- 'validateShell' src/renderer/src/components/settings/TerminalPane.tsx
sed -n '120,250p' src/renderer/src/components/settings/TerminalPane.tsx
printf '%s\n' '--- terminal batch helper call sites ---'
rg -n -F --glob '*.ts' --glob '*.tsx' --glob '!**/*.test.ts' --glob '!**/*.test.tsx' -e 'createTerminalPathExistenceBatch' -e 'fileLinkTargetExists(' src/renderer/src/components/terminal-pane
printf '%s\n' '--- link target implementation and callers ---'
sed -n '115,165p' src/renderer/src/components/terminal-pane/terminal-file-link-target.ts
sed -n '100,145p' src/renderer/src/components/terminal-pane/terminal-link-handlers.ts
sed -n '145,185p' src/renderer/src/components/terminal-pane/terminal-file-link-hit-testing.ts

Repository: stablyai/orca

Length of output: 13010


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.

@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: 93e8578e-4152-4119-aff4-1c41ba668524
Commits

Reviewing files that changed from the base of the PR and between 13efda8 and 8865eef.

Files selected for processing: 19
  • src/main/ipc/hooks/issue-command-wsl-running-signal.test.ts
  • src/main/ipc/hooks/register-worktree-hook-file-handlers.ts
  • src/main/ipc/hooks/worktree-hook-execution-host.test.ts
  • src/main/ipc/shell-path-existence-handlers.ts
  • src/main/ipc/shell-paths-exist-wsl-stopped-distro.test.ts
  • src/main/issue-command-file.ts
  • src/main/issue-command-wsl-stopped-distro.test.ts
  • src/main/runtime/rpc/methods/repo.test.ts
  • src/main/runtime/rpc/methods/repo.ts
  • src/main/runtime/runtime-repository-issue-command.ts
  • src/preload/api/agent-hook-api.ts
  • src/preload/api/hooks-bridge.ts
  • src/renderer/src/components/settings/repository/execution/RepositoryIssueCommandSetting.tsx
  • src/renderer/src/components/settings/use-repository-issue-command-wsl-stopped.test.ts
  • src/renderer/src/components/settings/use-repository-issue-command.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/runtime-hooks-client.ts
  • src/renderer/src/web/preload-api/web-review-api.ts
  • src/shared/rpc-contract/repo-params.ts
Files skipped from review as they are similar to previous changes: 1
  • src/main/ipc/shell-paths-exist-wsl-stopped-distro.test.ts

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

Comment on lines +54 to +57
if (result.status === 'error') {
const stopped = result.refusedWslDistro ?? null
setIssueCommandReadOnly(true)
setIssueCommandStoppedDistro(stopped)

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:

#!/bin/bash
# Check whether SSH-backed repos can render RepositoryIssueCommandSetting.
rg -n -C4 'RepositoryIssueCommandSetting|useRepositoryIssueCommand' src/renderer --type=ts --type=tsx

Repository: stablyai/orca

Length of output: 183


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- affected hook ---'
nl -ba src/renderer/src/components/settings/use-repository-issue-command.ts | sed -n '1,180p'
printf '%s\n' '--- IPC producer ---'
rg -n -C6 -F -- 'refusedWslDistro' src/main src/renderer src/shared || test "$?" -eq 1
printf '%s\n' '--- consumers and repository settings paths ---'
rg -n -C5 --glob '*.ts' --glob '*.tsx' -e 'RepositoryIssueCommandSetting' -e 'useRepositoryIssueCommand' src/renderer
printf '%s\n' '--- SSH repository settings references ---'
rg -n -C5 --glob '*.ts' --glob '*.tsx' -e 'ssh' -e 'RepositoryIssueCommandSetting' src/renderer/src/components/settings src/renderer/src | head -n 240

Repository: stablyai/orca

Length of output: 41238


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- IPC handler ---'
nl -ba src/main/ipc/hooks/register-worktree-hook-file-handlers.ts | sed -n '1,90p'
printf '%s\n' '--- runtime hooks client ---'
nl -ba src/renderer/src/runtime/runtime-hooks-client.ts | sed -n '1,150p'
printf '%s\n' '--- issue command producer ---'
nl -ba src/main/issue-command-file.ts | sed -n '55,90p'
printf '%s\n' '--- settings consumer references ---'
rg -n -C8 --glob '*.ts' --glob '*.tsx' -e 'RepositoryHooksSection' -e 'RepositoryIssueCommandSetting' -e 'useRepositoryIssueCommand' src/renderer/src/components/settings

Repository: stablyai/orca

Length of output: 42350


Script executed:

#!/bin/bash
set -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()) {

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Skip wake-enabled writes when the command is unchanged. · use-repository-issue-command.ts:131

src/renderer/src/components/settings/use-repository-issue-command.ts:131
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

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.

Files selected for processing: 12
  • src/renderer/src/components/settings/use-repository-issue-command-wsl-stopped.test.ts
  • src/renderer/src/components/settings/use-repository-issue-command.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json

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

The editor reads window.api optionally, as hosts without a preload do, and
the writer tests spy on the gated write that the handlers now call.
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