Repository navigation
fix(agent-launch): refuse an agent whose WSL runtime needs repair under its own code, in the settings page's words - #28232
Conversation
b2d72ad to
95d6791
Compare
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 ( 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 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). |
…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.
95d6791 to
45464f7
Compare
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f8ae69a0-7d62-4c06-8b1d-5341a089ab51
📒 Files selected for processing: 13
src/main/runtime/agent-launch-scope-runtime.test.tssrc/main/runtime/agent-launch-scope-runtime.tssrc/main/runtime/opencode-wsl-folder-launch-host.test.tssrc/main/runtime/rpc/errors.tssrc/main/runtime/rpc/methods/agent-launch-execution-outcome.tssrc/main/runtime/rpc/methods/agent-launch-failure-code.tssrc/main/runtime/rpc/methods/agent-launch-pane-reservation.test.tssrc/main/runtime/rpc/methods/agent-launch-replay.tssrc/main/runtime/rpc/methods/agent-launch.tssrc/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsxsrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/project-runtime-repair-message.test.tssrc/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.
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 launchcan'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 launchprintsOrca 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;Project runtime requires repair before terminal spawn: wsl-distro-missing, which names an internal reason code and no fix.Before → after
orca agent launchOrca could not confirm the launch outcome; …No agent was started. Ubuntu is not installed in WSL. Choose an installed distro or switch this project to Windows.Project runtime requires repair before terminal spawn: wsl-distro-missing--retry-launchor a phone resend of that launchThe other repair reasons read
No agent was started. WSL is not available. Switch this project to Windows or repair WSL.andNo 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 addsThis 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 inen-runtime-required.jsonbecause 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 codeproject_runtime_repair_requiredwith that sentence;rpc/errors.tspasses the code through.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):
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 toproject_runtime_repair_requiredwith 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:nodepasses; 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, codeproject_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-launchgives 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
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
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.Checklist
N/Awith reason (no new UI)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)