Repository navigation
fix(agent-detection): trust a WSL share path's distro in the agent list, over Orca's cached distro list - #28233
Conversation
b2d72ad to
95d6791
Compare
2bc457e to
59757ca
Compare
Status: ready for review (head 759ffe2, base main)#28232 is merged (287f430). This PR had its one rebase onto main: one commit, patch identical. It now targets main; #28234 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). Not exercised live: it needs a WSL distro installed after Orca read its distro list. Covered by its test. CI: green on 759ffe2 against main (18 pass, 0 fail); no open review threads; GitHub shows it mergeable. Re-checked after the rebase: node typecheck, its test and the neighbouring launch tests (28 pass), the repo checks, and the launch runtime rule is unchanged from main. Not verified: macOS, Linux and SSH hosts live (nothing changes there). |
95d6791 to
45464f7
Compare
…stro list The agent list for a \\wsl$ workspace with no saved runtime no longer checks the path's distro against Orca's cached list, which is read once and can be stale; the path proves the distro exists, as it already does for launches.
59757ca to
759ffe2
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
For a worktree stored inside a Linux distro's share (a
\\wsl$\<distro>\…path, how Windows reaches files inside WSL), the path itself proves the distro exists. But the list of installed agents that the phone, web and desktop clients show for such a worktree checks the distro against a list of installed distros Orca read once, at startup. A distro installed after Orca started is treated as missing. This PR trusts the path instead, as launches already do.What Changed
Built on #28232, now merged into main (287f430); this PR targets main. #27692 kept main's check for the agent list only; this PR removes it. #28234 sits on this PR.
The problem. A worktree at
\\wsl$\Ubuntu\…whose project has no saved runtime. Its agent list is built by probing inside the path's distro, but first Orca checks that distro against its cached list. If the distro was installed after Orca started, the cache says it doesn't exist, so the list shows the repair state instead of the installed agents. Launches in that same worktree already skip this check (#27692 keeps main's behaviour there: main never refused them).Before → after.
Mechanism.
local-project-runtime-resolution.ts:resolveLocalWorkspaceRuntimedrops the temporarytrustsWslPathparameter, so every caller, the agent list included, skips the cached-list check for a\\wsl$path whose project has no saved runtime.Why
The path proves the distro; the cached list can be stale, and the window already checks such a path against no cache. Refreshing the cache on every agent-list request was the alternative; it costs a
wsl.execall per request and is still racy.Size. Production +3 −5 (net −2), tests +5 −4 (net +1).
Linked Issue
Part of the launch-convergence plan (split out of #27692).
Visual Proof
N/A: the agent list's contents change only in the stale-cache case described above, which a hidden test copy can't reproduce on demand.
Testing
I manually tested these changes locally (not exercised live: it needs a distro installed after Orca read its distro list)
Automated tests added/updated
workspace-agent-detection.test.ts: the test Host plans agent launches with the window's runtime rule and one runtime fact (C1) #27692 pinned to main's behaviour (a\\wsl$worktree whose distro isn't in the cached list is reported as needing repair) is flipped: it now probes inside the path's distro.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.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
Checklist
N/Awith reason (no new UI)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)