Skip to content

fix(agent-launch): refuse an agent whose WSL runtime needs repair under its own code, in the settings page's words - #28232

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/conv-c1-s1-repair-refusal
Oct 14, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/conv-c1-s1-repair-refusal

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​49 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​106 $\color{#cf222e}{\Huge{\mathbf{−}}}$​38 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68

ELI5

When a project is set to run in WSL (Windows Subsystem for Linux) but that WSL setup is broken (the chosen Linux distro isn't installed, or WSL itself is unavailable), Orca refuses to start an agent there. Today the refusal is an internal sentence, and orca agent launch can't even tell it apart from a lost reply, so it says the agent "may already be running". This PR says plainly that nothing started and what to fix, in the same words the project settings page already uses, and repeats them if the launch is retried.

What Changed

Built on #27692, now merged into main (26a265d); this PR targets main. #27692 kept main's refusal for this case; this PR replaces it. #28233 sits on this PR.

The problem. A project set to a WSL distro that isn't installed (or with WSL unavailable). Any agent Orca's background service starts there is refused, but:

  • orca agent launch prints Orca could not confirm the launch outcome; the agent may already be running and the prompt may already be submitted., which suggests the opposite of what happened;
  • every other route (chats, the phone, orchestration workers, a new worktree's startup warning) shows Project runtime requires repair before terminal spawn: wsl-distro-missing, which names an internal reason code and no fix.

Before → after

Where Before After
orca agent launch Orca could not confirm the launch outcome; … a plain failure: No agent was started. Ubuntu is not installed in WSL. Choose an installed distro or switch this project to Windows.
chats, the phone, workers, automations, resume, a new worktree's startup warning Project runtime requires repair before terminal spawn: wsl-distro-missing the same sentence as the row above
--retry-launch or a phone resend of that launch the bare code the same sentence again

The other repair reasons read No agent was started. WSL is not available. Switch this project to Windows or repair WSL. and No agent was started. Choose a WSL distro or switch this project to Windows. When the WSL setting comes from the global default rather than the project, the sentence adds This project follows the default in Settings > Project Runtime. A plain terminal, and anything the window spawns itself, keep today's message.

Mechanism.

  • src/shared/project-runtime-repair-message.ts (new): the repair sentences, under the project settings page's existing translation keys. The settings page (ProjectWindowsRuntimeSetting.tsx) now reads them from here, so the page and the refusal can't drift; the keys are listed in en-runtime-required.json because the extractor can't see keys in a table.
  • agent-launch-scope-runtime.ts: the planner, which already refuses before anything spawns, throws the refusal under the new code project_runtime_repair_required with that sentence; rpc/errors.ts passes the code through.
  • The launch record keeps a coded refusal's words (agent-launch-replay.ts, agent-launch-failure-code.ts, agent-launch-execution-outcome.ts, agent-launch.ts), so a retry repeats them instead of the bare code.

Why

The refusal already happens before any spawn, so the host knows nothing ran; it just had no way to say so. Reusing the settings page's sentences gives one wording for one problem, from one module. The alternative, a separate host copy of the words, would drift from the page.

Temporary difference (moved here from #27692):

Rule Why Removed by
The refusal sentence is in English for every client (CLI, phone, paired desktops). Like the host's other refusals: "No agent was started." and the default-setting sentence have no translation keys, a host running without the desktop has no translator, and clients show the host's text as it is. Linear STA-10308: clients word the sentence in their own language from the repair reason through projectRuntimeRepairSentence, the same mapping the settings page uses; the host's English stays as the fallback for older clients. That needs the host to add the repair reason to the refusal's data (for example { reason, distro, source }); today the refusal carries only its code and message.

Size. Production +106 −38 (net +68), tests +49 −6 (net +43).

Linked Issue

Part of the launch-convergence plan (split out of #27692).

Visual Proof

N/A: no new UI; the change is CLI and message text, shown above.

Testing

  • I manually tested these changes locally (Windows + WSL, on Host plans agent launches with the window's runtime rule and one runtime fact (C1) #27692's earlier head that carried this change, see below)

  • Automated tests added/updated

  • opencode-wsl-folder-launch-host.test.ts: the test Host plans agent launches with the window's runtime rule and one runtime fact (C1) #27692 pinned to main's words (runtime_error, "Project runtime requires repair before terminal spawn: wsl-distro-missing") is flipped to project_runtime_repair_required with the new sentence, through the real chat-create request and its error mapping.

  • agent-launch-scope-runtime.test.ts: the stale-distro test now expects the new words.

  • src/renderer/src/i18n/project-runtime-repair-message.test.ts (new): each repair reason is worded under the settings page's key, with the window's English for that key, plus the default-setting sentence.

  • agent-launch-pane-reservation.test.ts: a retry repeats a coded refusal's own words.

Run on this branch: tc:node passes; Vitest on 45 named files (every test that imports a module the launch split touched, the agent-launch request tests and the launch characterization suites): 606 tests pass; the changed-code quality check passes.

Live QA (Windows, WSL Ubuntu-24.04, a hidden test copy of Orca; report ~/orca-qa/qa-c1/report.md, row W5d, final run on 20ce184, which carried this change): orca agent launch --agent codex --worktree folder:<f5> with the project's distro missing → exit 1, code project_runtime_repair_required, No agent was started. NoSuchDistro is not installed in WSL. Choose an installed distro or switch this project to Windows.; no terminal created; --retry-launch gives the same refusal. On main the same kind of launch printed "Orca could not confirm the launch outcome…".

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

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Wire compatibility: one new error code, project_runtime_repair_required. A client that doesn't know it reads it as a plain failure and shows the message; a newer CLI talking to an older host behaves as today.
  • SSH: unchanged (remote launches have no local project runtime).

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 (no new UI)
  • 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)

@brennanb2025

brennanb2025 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Status: ready for review (head 45464f7, base main)

#27692 is merged (26a265d). This PR had its one rebase onto main: one commit, patch unchanged (only surrounding lines that main had moved differ). It now targets main and is next in the stack; #28233 sits on it.

Review. Part of the split of #27692 (one thing per PR). A review of the whole stack found nothing in this PR: it does one thing, its description matches its diff, and its test was run on this PR (passes) and against the PR below (fails).

Live QA on Windows: the old W5d rows on the pre-split head 20ce184 (orca agent launch into a folder whose WSL distro is missing printed "No agent was started. NoSuchDistro is not installed in WSL…" under project_runtime_repair_required; --retry-launch repeated it). Not re-run on this head; its code is unchanged since then.

CI: green on 45464f7 against main (22 pass, 0 fail). Two unrelated jobs needed one rerun each: a mobile web-shell throughput test and a daemon test whose real bash spawn timed out on the runner; this PR touches neither area.

Re-checked after the rebase: node, web and CLI typechecks; its tests and the neighbouring launch tests (51 pass); the repo checks; and the launch runtime rule is unchanged from main.

Not verified: macOS, Linux and SSH hosts live (nothing changes there).

@brennanb2025
brennanb2025 marked this pull request as ready for review October 13, 2026 10:37
…ts own code, in the settings page's words

A launch whose project runtime needs repair is now refused with
project_runtime_repair_required and the project settings page's sentence, instead of
"Project runtime requires repair before terminal spawn: <reason>"; a retry repeats it.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/conv-c1-s1-repair-refusal branch from 95d6791 to 45464f7 Compare October 13, 2026 22:04
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/conv-c1-host-planner to main October 13, 2026 22:04
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Windows local agent launches now throw a coded refusal when the project runtime requires repair. RPC error mapping preserves that code, and launch replay retains available failure messages. Project runtime settings use shared wording for repair reasons, with English locale entries and tests for the messages.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 45464

Some Windows OpenCode folder launches can proceed without the required runtime-repair refusal. Fix that path before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 12 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly identifies the main change: agent launches now refuse WSL runtimes that require repair and use the settings page wording. It is somewhat long but remains specific and relevant.
Description check Passed The description is comprehensive and follows the required template. It explains the user impact, mechanism, rationale, testing, compatibility considerations, and visual-proof exception. It references …
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 12 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8ae69a0-7d62-4c06-8b1d-5341a089ab51
📥 Commits

Reviewing files that changed from the base of the PR and between 26a265d and 45464f7.

📒 Files selected for processing: 13
  • src/main/runtime/agent-launch-scope-runtime.test.ts
  • src/main/runtime/agent-launch-scope-runtime.ts
  • src/main/runtime/opencode-wsl-folder-launch-host.test.ts
  • src/main/runtime/rpc/errors.ts
  • src/main/runtime/rpc/methods/agent-launch-execution-outcome.ts
  • src/main/runtime/rpc/methods/agent-launch-failure-code.ts
  • src/main/runtime/rpc/methods/agent-launch-pane-reservation.test.ts
  • src/main/runtime/rpc/methods/agent-launch-replay.ts
  • src/main/runtime/rpc/methods/agent-launch.ts
  • src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/project-runtime-repair-message.test.ts
  • src/shared/project-runtime-repair-message.ts

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

@brennanb2025
brennanb2025 merged commit 287f430 into main Oct 14, 2026
61 of 64 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/conv-c1-s1-repair-refusal branch October 14, 2026 04:49
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