Repository navigation
fix(agents): detect agent CLIs installed outside a version manager - #18336
Conversation
The install-dir fallback that answers "is this agent installed?" when the login-shell PATH probe fails listed only version-manager bin dirs, so codex/opencode/cursor-agent installed by Homebrew, npm's default global prefix, snap, nix, or the CLI's own installer read as not installed. Where this is decisive, corrected from the previous message: the `orca` CLI, whose detectSkillsCliAgentKeys (src/cli/handlers/skills.ts) calls detectCommandsInInstallDirs directly and whose entry point seeds no PATH, plus unpackaged/dev runs. NOT the packaged desktop app: patchPackagedProcessPath (configure-process.ts:114) appends /opt/homebrew/bin, /usr/local/bin, ~/.opencode/bin and the Linux/nix prefixes onto process.env.PATH at main-process-preflight.ts:147, before any detection, and mergePathSegments preserves them, so the PATH scan reaches those dirs first and this fallback never fires for them. That means this does NOT explain the packaged macOS v1.4.194 report of codex/cursor-agent/opencode all undetected -- that report stays open and uninvestigated. Second correction: the fallback now carries the prefixes Homebrew actually uses on Linux (/home/linuxbrew/.linuxbrew/bin), plus /snap/bin and the two nix profile dirs, matching what patchPackagedProcessPath already seeds. The WSL guest prelude gains the same entries. Leaving them out closed the native/WSL asymmetry on darwin only, on the platforms where the fallback is decisive. Appended last so a version-manager install still wins, and kept out of getVersionManagerBinPaths, whose result is PREPENDED to PATH (#18234). Lives in its own module so node-cli-command-resolution.ts stays under max-lines. The test stages every path through `join` and asserts via detectCommandsInInstallDirs as well as resolveCliCommands, so it holds on a Windows dev machine and pins the "absolute path means installed" contract.
Round-2 review remediation. The blocking finding was about the handoff artifact, not the code: the summary handed to review described a 2-file/+38 change with 3 new macOS dirs, while HEAD is 4 files/+227 with 6 lookup dirs plus 5 new WSL-guest prelude entries, and the quoted failing test names never existed. Restated against HEAD in the handoff; no rebuttal, the reviewer was right. Justification for the entries the summary never described: the fallback exists to close the native/WSL asymmetry for a CLI no version manager installed, and patchPackagedProcessPath already seeds Linuxbrew, /snap/bin and both nix profile dirs (configure-process.ts:141-158). Shipping only the darwin subset would have left a Linux or WSL user with a snap/nix install still reading as not installed while the packaged macOS user did not -- the asymmetry the change is for. Code changes, all from the non-blocking list: - The three lists disagreed on order while claiming to be kept in step, so a CLI in both /usr/local/bin and /snap/bin could resolve to a different binary than the seeded PATH scan or the WSL guest probe found. All three now use the seed's relative order, pinned by a new duplicate-install test and an offset assertion on the prelude. The prelude's system block also moved after the nvm glob so a version manager still wins in the guest, as it does natively. - The parity docstring asserted "the same set patchPackagedProcessPath appends, minus the sbin dirs and the generic ~/bin", which was false: it also omits ~/.vite-plus/bin (seeded by configure-process.ts:156, but no probed agent command maps to it) and /opt/homebrew off darwin. All three gaps are now named as deliberate. - win32 returns [] and stays that way, but the branch now says why: %USERPROFILE%\.opencode\bin has never had install-dir coverage in either list, and the seed's system block is POSIX-only too. Pre-existing, unchanged. - The detectCommandsInInstallDirs case read the ambient process.env.PATH, so on a box with /usr/local/bin on PATH only the opencode assertion exercised the fallback. It now stubs the GUI-launch PATH, so both do. Unchanged and restated: this does NOT explain the packaged macOS v1.4.194 report of codex/cursor-agent/opencode all undetected, and must not close G6 report #3. patchPackagedProcessPath returns early unless app.isPackaged and seeds all six dirs before any detection, and mergePathSegments never deletes them, so the packaged PATH scan reaches them first and this fallback never fires there. Decisive only for the `orca` CLI's detectSkillsCliAgentKeys and unpackaged/dev runs. Verification: the suite is red without the production hunks (5 failed/3 passed) and green with them (8 passed); 11 related suites pass (197 tests); tc:node, tc:cli, oxlint, oxfmt and the max-lines ratchet are clean.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds a platform-aware system CLI install-directory lookup. CLI resolution now uses one ordered fallback list for single and batch lookups. Windows returns no system directories. POSIX fallback paths now include snap, Linuxbrew, nix, Merge Risk: ⚪ Minimal · up to This change finds supported CLI installations missed by PATH while retaining existing PATH and version-manager precedence. Platform behavior and fallback ordering are covered, with no remaining merge-readiness risk identified. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides extensive technical context, scope, rationale, limitations, follow-ups, and test evidence. However, it omits several required template sections or equivalents, including Linked Issue with a Resolution Add the missing template sections. Include the linked issue using
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
A narrow, well-scoped fix that extends the CLI install-dir fallback to cover install locations no version manager owns (Homebrew, npm global prefix, snap, nix, ~/.opencode/bin), in both resolveCliCommand and resolveCliCommands, and mirrors the same dirs into the WSL guest PATH prelude. win32 is deliberately unchanged.
- New
getSystemCliInstallDirectories(src/shared/system-cli-install-dirs.ts) — appended last in the fallback list, ordered to match the packaged-app PATH seed, and kept out of the prependedgetVersionManagerBinPathslist (#18234). - Resolver wiring (
src/shared/node-cli-command-resolution.ts) — appends the system dirs after the version-manager dirs in both resolvers, so a version-manager install still outranks a system one. - WSL prelude parity (
src/shared/posix-version-manager-bin-dirs.ts) — adds the system dirs (appended) and moves the nvm glob ahead of/usr/local/binso a version-manager install outranks a system one in the guest, matching native. - Regression tests (
src/shared/agent-cli-install-dir-fallback.test.ts) — 8 cases pinning macOS/Linux resolution, ordering vs the PATH seed, the version-manager-over-system rule, thewin32no-op, and the detection contract throughdetectCommandsInInstallDirs.
The tests are genuinely strong (exact toEqual, ordering pinned by iterative deletion, the detectCommandsInInstallDirs case stubs a GUI-launch PATH so it exercises the fallback), not theatre. I verified the suite passes locally (8/8). The scope honesty in the PR body — that this does not explain the packaged macOS v1.4.194 report and must not close G6 report #3 — is correct and worth keeping.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…ak guard Round-3 review found two docstring claims that are false as written and one guard that only asserted a third of its list. - system-cli-install-dirs.ts claimed a CLI in two of these dirs resolves the same here as in the packaged PATH seed. True inside the system block, false across it: `claude` in both ~/.local/bin and /opt/homebrew/bin resolves to ~/.local/bin via the fallback (getBaseVersionManagerDirectories leads) and to /opt/homebrew/bin via the seed, which appends ~/.local/bin last. Scope the claim to the block and name the gap instead of asserting it away. No behavior change: closing it would hoist a system dir over a version-manager one (#18234). - posix-version-manager-bin-dirs.ts justified moving "/usr/local/bin" after the nvm glob with "a version manager still wins in the guest, as it does natively". The glob expands lexicographically; native orders nvm dirs default-alias-first (#10932), so that is not parity. Record the move as the one behavior change in the file and bound it: entries are appended behind a resolved login PATH, and both consumers only test presence. - The #18234 seed-leak guard asserted only /opt/homebrew/bin and /usr/local/bin were absent from getVersionManagerBinPaths, leaving the four other new dirs unpinned. It now spells out all seven across darwin and linux -- spelled out rather than derived from getSystemCliInstallDirectories, which would pass vacuously against exactly the refactor it guards. Tests 8 passed (8); 5 failed / 3 passed with the production hunks reverted to origin/main. tsc node + cli clean, oxlint clean.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This delta (bcd5948) retires the prior review's one open thread and hardens the seed-leak guard. No production behavior changed.
- Ordering-parity claims corrected (
src/shared/posix-version-manager-bin-dirs.ts) — the "same relative order as the other two lists" claim is narrowed to a block-level lead/trail statement, the/usr/local/binmove is now described accurately, and the nvm-glob non-parity is named (#10932). - Parity scoped to within the system block (
src/shared/system-cli-install-dirs.ts) — the claim no longer crosses the block boundary; the~/.local/bin-vs-Homebrew divergence is stated rather than asserted away. - Seed-leak guard widened (
src/shared/agent-cli-install-dir-fallback.test.ts) — the guard now asserts all seven system dirs stay out ofgetVersionManagerBinPathson both darwin and linux, spelled out rather than derived from the list under test so it cannot pass vacuously.
The widened guard is a real assertion (it fails if a system dir leaks into the prepended list), not theatre. Verified agent-cli-install-dir-fallback.test.ts passes locally (8/8).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The fallback added `~/.opencode/bin` but skipped `~/.vite-plus/bin` on the claim that no probed agent command maps to it. False: `pi` is a probed detect command on every runtime (`tui-agent-config.ts`, no `detectUnsupportedRuntimes`) and `~/.vite-plus/bin` is the Pi installer's default — the two dirs #829 named and `patchPackagedProcessPath` seeds together. Added to both the native fallback and the WSL guest prelude, so a Pi installed by its own script is found by the `orca` CLI and in WSL, not just on a seeded packaged PATH. Also, all narrower: - `/snap/bin` + Linuxbrew now gate on `linux` like the seed does, instead of every non-darwin posix. - Docstring: `/opt/homebrew` off darwin is the one remaining seed gap and says why; the "lookup-only" paragraph names the `withCliRuntimeOnPath` exception. - New seed-order test derives the expected order from `getSystemCliInstallDirectories`, so reordering either list fails. The PR body's claim that SSH hosts benefit is dropped: they answer `preflight.detectAgents` from `src/relay/preflight-handler.ts` via `isCommandOnPathForRelay`, a separate bundle that never reaches this module.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Added
~/.vite-plus/binto the install-dir fallback (src/shared/system-cli-install-dirs.ts,src/shared/posix-version-manager-bin-dirs.ts) — the Pi installer's default (#829), so apiinstalled by its own script resolves as detected rather than "not installed"; mirrored into the WSL guest prelude too. - Narrowed snap/Linuxbrew gating to
platform === 'linux'(src/shared/system-cli-install-dirs.ts) — previously every non-darwin POSIX got phantom/snap/binand Linuxbrew stats; now gated exactly like the PATH seed. - Derived the seed-order parity guard (
src/main/startup/configure-process.test.ts) — the new test checkspatchPackagedProcessPath's system block againstgetSystemCliInstallDirectoriesorder rather than a second hardcoded literal, so reordering either list fails. - Widened the tests (
src/shared/agent-cli-install-dir-fallback.test.ts) — addedpito the detection case and~/.vite-plus/binto the ordering and seed-leak guards.
This closes the round-4 ~/.vite-plus/bin gap: the premise that no probed agent command maps to it was falsified (pi is probed on every runtime via tui-agent-config.ts), and the dir is now covered in the native fallback, the WSL prelude, and the tests. The platform === 'linux' narrowing matches patchPackagedProcessPath byte-for-byte and is pinned by the new parity guard.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
… on both resolvers resolveCliCommand (every spawn site) and resolveCliCommands (detection) each spelled the nvm -> version-manager -> system-dir order by hand, which is how the native and WSL lists drifted apart before. One getCliInstallDirectories now feeds both, and the test pins system dirs LAST on both resolvers, on darwin and linux, plus a derived check that the WSL guest prelude keeps every native version-manager dir ahead of the native system block.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review (2666af8), this delta is a behavior-preserving refactor plus test hardening:
- Consolidated the fallback order into one shared list (
src/shared/node-cli-command-resolution.ts) — a newgetCliInstallDirectoriesbuilds thenvm → version-manager → system-dirorder once, and bothresolveCliCommand(the spawn-site path) andresolveCliCommands(detection) now consume it, removing the two hand-spelled spreads that were the drift vector. - Pinned the ordering on both resolvers and both platforms (
src/shared/agent-cli-install-dir-fallback.test.ts) — the version-manager /~/.local/bin/ PATH-outrank-a-system-copy cases now run throughresolveCliCommandas well asresolveCliCommands, over darwin and linux viadescribe.each. - Added a derived WSL-prelude parity guard (
src/shared/agent-cli-install-dir-fallback.test.ts) — asserts every native version-manager dir fromgetVersionManagerBinPathsprecedes the first system dir in the guest prelude, scoped to the block boundary rather than intra-block order.
The resolved directory order is identical before and after the refactor. Verified the touched suites pass (agent-cli-install-dir-fallback.test.ts 14 tests, configure-process.test.ts 41 tests).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…tablyai#18336) * fix(agents): detect agent CLIs installed outside a version manager The install-dir fallback that answers "is this agent installed?" when the login-shell PATH probe fails listed only version-manager bin dirs, so codex/opencode/cursor-agent installed by Homebrew, npm's default global prefix, snap, nix, or the CLI's own installer read as not installed. Where this is decisive, corrected from the previous message: the `orca` CLI, whose detectSkillsCliAgentKeys (src/cli/handlers/skills.ts) calls detectCommandsInInstallDirs directly and whose entry point seeds no PATH, plus unpackaged/dev runs. NOT the packaged desktop app: patchPackagedProcessPath (configure-process.ts:114) appends /opt/homebrew/bin, /usr/local/bin, ~/.opencode/bin and the Linux/nix prefixes onto process.env.PATH at main-process-preflight.ts:147, before any detection, and mergePathSegments preserves them, so the PATH scan reaches those dirs first and this fallback never fires for them. That means this does NOT explain the packaged macOS v1.4.194 report of codex/cursor-agent/opencode all undetected -- that report stays open and uninvestigated. Second correction: the fallback now carries the prefixes Homebrew actually uses on Linux (/home/linuxbrew/.linuxbrew/bin), plus /snap/bin and the two nix profile dirs, matching what patchPackagedProcessPath already seeds. The WSL guest prelude gains the same entries. Leaving them out closed the native/WSL asymmetry on darwin only, on the platforms where the fallback is decisive. Appended last so a version-manager install still wins, and kept out of getVersionManagerBinPaths, whose result is PREPENDED to PATH (stablyai#18234). Lives in its own module so node-cli-command-resolution.ts stays under max-lines. The test stages every path through `join` and asserts via detectCommandsInInstallDirs as well as resolveCliCommands, so it holds on a Windows dev machine and pins the "absolute path means installed" contract. * fix(agents): align system install-dir order across the three PATH lists Round-2 review remediation. The blocking finding was about the handoff artifact, not the code: the summary handed to review described a 2-file/+38 change with 3 new macOS dirs, while HEAD is 4 files/+227 with 6 lookup dirs plus 5 new WSL-guest prelude entries, and the quoted failing test names never existed. Restated against HEAD in the handoff; no rebuttal, the reviewer was right. Justification for the entries the summary never described: the fallback exists to close the native/WSL asymmetry for a CLI no version manager installed, and patchPackagedProcessPath already seeds Linuxbrew, /snap/bin and both nix profile dirs (configure-process.ts:141-158). Shipping only the darwin subset would have left a Linux or WSL user with a snap/nix install still reading as not installed while the packaged macOS user did not -- the asymmetry the change is for. Code changes, all from the non-blocking list: - The three lists disagreed on order while claiming to be kept in step, so a CLI in both /usr/local/bin and /snap/bin could resolve to a different binary than the seeded PATH scan or the WSL guest probe found. All three now use the seed's relative order, pinned by a new duplicate-install test and an offset assertion on the prelude. The prelude's system block also moved after the nvm glob so a version manager still wins in the guest, as it does natively. - The parity docstring asserted "the same set patchPackagedProcessPath appends, minus the sbin dirs and the generic ~/bin", which was false: it also omits ~/.vite-plus/bin (seeded by configure-process.ts:156, but no probed agent command maps to it) and /opt/homebrew off darwin. All three gaps are now named as deliberate. - win32 returns [] and stays that way, but the branch now says why: %USERPROFILE%\.opencode\bin has never had install-dir coverage in either list, and the seed's system block is POSIX-only too. Pre-existing, unchanged. - The detectCommandsInInstallDirs case read the ambient process.env.PATH, so on a box with /usr/local/bin on PATH only the opencode assertion exercised the fallback. It now stubs the GUI-launch PATH, so both do. Unchanged and restated: this does NOT explain the packaged macOS v1.4.194 report of codex/cursor-agent/opencode all undetected, and must not close G6 report stablyai#3. patchPackagedProcessPath returns early unless app.isPackaged and seeds all six dirs before any detection, and mergePathSegments never deletes them, so the packaged PATH scan reaches them first and this fallback never fires there. Decisive only for the `orca` CLI's detectSkillsCliAgentKeys and unpackaged/dev runs. Verification: the suite is red without the production hunks (5 failed/3 passed) and green with them (8 passed); 11 related suites pass (197 tests); tc:node, tc:cli, oxlint, oxfmt and the max-lines ratchet are clean. * fix(agents): correct the ordering-parity claims and widen the seed-leak guard Round-3 review found two docstring claims that are false as written and one guard that only asserted a third of its list. - system-cli-install-dirs.ts claimed a CLI in two of these dirs resolves the same here as in the packaged PATH seed. True inside the system block, false across it: `claude` in both ~/.local/bin and /opt/homebrew/bin resolves to ~/.local/bin via the fallback (getBaseVersionManagerDirectories leads) and to /opt/homebrew/bin via the seed, which appends ~/.local/bin last. Scope the claim to the block and name the gap instead of asserting it away. No behavior change: closing it would hoist a system dir over a version-manager one (stablyai#18234). - posix-version-manager-bin-dirs.ts justified moving "/usr/local/bin" after the nvm glob with "a version manager still wins in the guest, as it does natively". The glob expands lexicographically; native orders nvm dirs default-alias-first (stablyai#10932), so that is not parity. Record the move as the one behavior change in the file and bound it: entries are appended behind a resolved login PATH, and both consumers only test presence. - The stablyai#18234 seed-leak guard asserted only /opt/homebrew/bin and /usr/local/bin were absent from getVersionManagerBinPaths, leaving the four other new dirs unpinned. It now spells out all seven across darwin and linux -- spelled out rather than derived from getSystemCliInstallDirectories, which would pass vacuously against exactly the refactor it guards. Tests 8 passed (8); 5 failed / 3 passed with the production hunks reverted to origin/main. tsc node + cli clean, oxlint clean. * fix(agents): find Pi's own installer dir in the CLI install-dir fallback The fallback added `~/.opencode/bin` but skipped `~/.vite-plus/bin` on the claim that no probed agent command maps to it. False: `pi` is a probed detect command on every runtime (`tui-agent-config.ts`, no `detectUnsupportedRuntimes`) and `~/.vite-plus/bin` is the Pi installer's default — the two dirs stablyai#829 named and `patchPackagedProcessPath` seeds together. Added to both the native fallback and the WSL guest prelude, so a Pi installed by its own script is found by the `orca` CLI and in WSL, not just on a seeded packaged PATH. Also, all narrower: - `/snap/bin` + Linuxbrew now gate on `linux` like the seed does, instead of every non-darwin posix. - Docstring: `/opt/homebrew` off darwin is the one remaining seed gap and says why; the "lookup-only" paragraph names the `withCliRuntimeOnPath` exception. - New seed-order test derives the expected order from `getSystemCliInstallDirectories`, so reordering either list fails. The PR body's claim that SSH hosts benefit is dropped: they answer `preflight.detectAgents` from `src/relay/preflight-handler.ts` via `isCommandOnPathForRelay`, a separate bundle that never reaches this module. * fix(agents): build the CLI install-dir fallback order once and pin it on both resolvers resolveCliCommand (every spawn site) and resolveCliCommands (detection) each spelled the nvm -> version-manager -> system-dir order by hand, which is how the native and WSL lists drifted apart before. One getCliInstallDirectories now feeds both, and the test pins system dirs LAST on both resolvers, on darwin and linux, plus a derived check that the WSL guest prelude keeps every native version-manager dir ahead of the native system block.

What
Cluster G6 /
agent-cli-path-resolution, 1 field report (report #3 in the G6 bucket): "安装的智能体扫描不到,Codex、Cursor、OpenCode,全识别不到" — "the installed agents can't be scanned, Codex / Cursor / OpenCode, none of them are recognized." Reported on macOS, Orca v1.4.194.Orca answers "is this agent CLI installed?" two ways: scan
PATH, and if that misses, probe a hard-coded list of install directories. That fallback list —getBaseVersionManagerDirectories, consumed atsrc/shared/node-cli-command-resolution.ts:270(resolveCliCommand) and:286(resolveCliCommands) onorigin/main— contained only version-manager bin dirs (nvm, asdf, mise, volta, fnm, pnpm, bun, yarn,~/.local/bin). It contained no Homebrew prefix, no npm default global prefix, no snap, no nix, and neither of the two installer-owned dirs #829 named (~/.opencode/bin,~/.vite-plus/bin).So a
codex/cursor-agent/opencodeinstalled by Homebrew,npm -g, snap, nix, or the CLI's own installer read as not installed whenever thePATHscan missed it.src/main/preflight/agent-detection.ts:160,166andsrc/cli/handlers/skills.ts:167both route through that list.Two more asymmetries fixed alongside it, because the whole point of the fallback is that it match what Orca does elsewhere:
patchPackagedProcessPath(src/main/startup/configure-process.ts:114) already seeds every one of these dirs ontoprocess.env.PATH(:140-156; eight across darwin and linux, six on any single platform). The fallback list did not, so the same install answered "installed" or "not installed" depending on which list ran.src/shared/posix-version-manager-bin-dirs.ts) — whose docstring already claimed parity with the native list — had/usr/local/binand nothing else, so a WSL user on Linuxbrew/snap/nix hit [Bug]: Agent detection failed on Windows (WSL) #9725 while the same user on native did not.The change adds
src/shared/system-cli-install-dirs.ts(getSystemCliInstallDirectories—/opt/homebrew/binon darwin, then/usr/local/bin,/snap/bin+/home/linuxbrew/.linuxbrew/binon linux,/nix/var/nix/profiles/default/bin,~/.nix-profile/bin,~/.opencode/bin,~/.vite-plus/bin), appends it last in both resolvers, and mirrors it into the WSL prelude.win32returns[]— the Windows branch is byte-for-byte unchanged.Scope honesty, stated up front
This does not explain the reporter's packaged macOS v1.4.194 failure, and must not close G6 report #3.
patchPackagedProcessPathreturns early unlessapp.isPackaged(configure-process.ts:114-117), and when packaged it seeds every one of those dirs ontoPATHatmain-process-preflight.ts:147, before any detection runs;mergePathSegments(hydrate-shell-path.ts:382-385) never deletes them. So in the packaged desktop app thePATHscan reaches those dirs first and this fallback never fires for them.Round 5 checked this against the reporter's exact build rather than against
main, and it is even more decisive there:git show v1.4.194:src/main/startup/configure-process.tsshows all of/opt/homebrew/bin,/usr/local/bin,/nix/var/nix/profiles/default/bin,~/.nix-profile/bin,~/.opencode/bin,~/.vite-plus/bininextraPaths, prepended ([...missing, ...currentPath]) — not appended as onmaintoday. On v1.4.194 those dirs ledPATHbefore any detection ran.~/.opencode/binhas been seeded since #843 (2026-04-19).The fallback is decisive for exactly these populations: the
orcaCLI (src/cli/handlers/skills.ts:167,src/cli/handlers/account.ts:97—src/cli/index.tsseeds no PATH), unpackaged / dev runs, and WSL guests via the prelude. Earlier revisions of this body also named the SSH host runtime; that was wrong and is retracted — see Trade-offs → SSH hosts and Round 4. That report stays open. This PR must not be merged with a closing keyword pointed at it, and there is none in this body or in any of the four commit messages (grep -inE 'fixes #|closes #|resolves #'→ no match in either).Fix evidence
Every command in this section was re-run at HEAD
2666af8immediately before this revision was published. Nothing here is quoted from an earlier round.Regression test RED with the production hunks reverted to
origin/mainThe first red row reproduces the field report's symptom shape —
clauderesolves,codex+cursor-agent+opencodedo not. It is not a reproduction of the reporter's machine, and per Scope honesty above this fallback is not the code path their packaged build took; read it as "this omission is capable of producing that symptom", nothing stronger.The
reports a system-installed CLI as detected, not just resolvedcase asserts throughdetectCommandsInInstallDirs— the exact functionsrc/cli/handlers/skills.ts:167andsrc/main/preflight/agent-detection.ts:166call — with a stubbed GUI-launchPATH, so it pins the real "absolute path means installed" contract, not just the resolver.GREEN with the production hunks restored
The 3 cases green in both states are the no-regression guards:
win32returns[]; a version-manager install still outranks a system one; and the system dirs stay out ofgetVersionManagerBinPaths, whose result is prepended toPATH(#18234).Blast-radius suites, typecheck, lint
Note on that last command: an earlier revision quoted it as
pnpm run check:code-quality:changedreporting 4 changed files. Both details were stale — the branch has covered 5 files sincebcd5948addedconfigure-process.test.ts, and on this machine thepnpm runwrapper aborts in its own preinstall step (ERR_PNPM_CMD_SHIM_CHMODonelectron-osx-sign) before the gate runs, so the underlying script is invoked directly. The gate itself passes.Round-4 fix: the
~/.vite-plus/bingap, pinned against the previous HEADi.e. at round-3 HEAD (
bcd5948) apiinstalled by its own installer into~/.vite-plus/binwas reported not installed by the widened fallback. Green again at2666af8. The worktree was restored to clean (git status --shortempty) after both experiments.Round-5 check: is the relay really unreachable from this module?
The claim under Trade-offs → SSH hosts is that nothing in the SSH relay can reach
node-cli-command-resolution.ts. Round 5 falsified the reason the previous revision gave for it, so the claim was re-derived by walking the actual import graph from all 182 non-testsrc/relay/*.tsfiles (a superset of the real esbuild entrypointssrc/relay/relay.ts,ai-vault-service-entry.ts,wsl-transcript-fs-process-entry.ts, …):What is NOT proven — stated plainly
PATHbefore detection ran, so this fallback is not reached for them there. There is no crash dump, no user log, and no repro that ties the reporter's machine to this code path.PATHof/usr/bin:/bin:/usr/sbin:/sbinwith no seed applied. No packaged build has ever had thatPATH, becausepatchPackagedProcessPathruns first. It demonstrated the mechanism, not the reporter's machine, and is not cited as support anywhere in this body.onboarding_agent_picked, 90d) actively argues against the "login-shell hydration failed, so the fallback ran and lost the agents" story: on darwin, sessions that fell back to the seed-only PATH reported zero detected agents 2.9% of the time (198/6936) versus 7.9% (15205/192306) for sessions with a successful shell hydration. That comparison is confounded by selection, so it is not causal in either direction — but it does not support the hypothesis, and it is reported as it came back rather than omitted.ELI5
To run a coding agent, Orca first has to find its program on your computer. It looks in two places: the list of folders your system normally searches, and — if that comes up empty — a short built-in list of backup folders.
That backup list only had folders used by "version managers": tools some developers use to juggle multiple versions of Node. If you installed Codex or OpenCode or Cursor the ordinary way — Homebrew, npm, snap, or the tool's own installer — your copy lived somewhere that was not on the backup list at all. Orca would look, not find it, and tell you the agent wasn't installed, even though it was sitting right there.
This change adds the ordinary install folders to that backup list, on Mac, Linux and inside the Linux environment that Windows users run Orca through. The backup folders are always checked last, after the ones your system already searches, so on Mac and Linux nothing Orca finds today can start pointing at a different copy — the only change is that something previously reported missing is now found. (One small exception, in the Windows-through-Linux case only: two of the backup folders swapped places. That could only matter for someone who keeps two copies of the same tool in exactly those two folders, and even then Orca is only checking whether the tool is there at all.)
Being straight about it: we could not prove this is what happened to the one user who reported it. Their version of Orca already searched those folders a different way. So this fixes a real hole we can demonstrate with a test, but the original report stays open.
Trade-offs
Everything below is confined to the "
PATHmissed this command entirely" branch. In the two native resolvers (resolveCliCommand,resolveCliCommands)PATHis scanned first and the new entries are appended last within the fallback list, so no command that resolves natively today can resolve differently. That statement does not extend to the WSL guest prelude, which contains one ordering change — see the WSL guests bullet below, which states it rather than denying it.Newly-resolving commands. A command previously returned as a bare name (i.e. reported not-installed) can now resolve to an absolute path under
/opt/homebrew/bin,/usr/local/bin,/snap/bin,/home/linuxbrew/.linuxbrew/bin,/nix/var/nix/profiles/default/bin,~/.nix-profile/bin,~/.opencode/binor~/.vite-plus/bin. This is the intended behaviour change. AffectsorcaCLI users, dev/unpackaged runs, and WSL guests; packaged desktop users are already covered by the PATH seed.Real cost — runtime pairing.
withCliRuntimeOnPath(node-cli-command-resolution.ts:343) prepends a resolved binary's own directory onto the spawned child'sPATHwhen that directory also ships a siblingnode(the [Bug]: CLI agents crash afternvm install <newer>— Orca picks newest nvm node for PATH but spawns CLIs from older nvm node (ABI mismatch) #10932 binary/runtime pairing rule). A fallback hit in/usr/local/binor/opt/homebrew/bintherefore now hoists that system dir ahead of the user's version-manager node for the spawned agent only. This is a genuine behaviour change, disclosed rather than buried. It fires only whenPATHcontained no copy of the CLI at all — and in that situation the alternative is not running the agent, so the trade is favourable. In the packaged app the PATH scan already returned those same absolute paths, so the prepend already happened before this change.Widened spawn set, and the shadowing it could have introduced. These resolvers do not only detect:
resolveCliCommand/resolveCodexCommand/resolveClaudeCommandfeed ~15 spawn sites (codex login, app-server, session-index heal, state-dir ops,orcaCLI account/skills). A fallback hit in/usr/local/binor/opt/homebrew/binis therefore a binary Orca will run, and those are shared prefixes where a same-named, unrelated binary can live. Two things bound that, and the second is new in this revision:~/.local/bin/ pnpm / yarn / bun → system dirs. A CLI the user has anywhere a version manager or their own PATH knows about always wins; a system dir is only ever consulted for a command that nothing else on the machine has.getCliInstallDirectoriesinnode-cli-command-resolution.ts) and shared by both native resolvers instead of being two hand-spelled spreads — the singular resolver (the one every spawn site calls) had its own copy.agent-cli-install-dir-fallback.test.tspins the guarantee on both resolvers, on darwin and linux, for a version-manager hit, a~/.local/binhit, and a PATH hit each outranking a staged system copy; and a derived test asserts the WSL guest prelude keeps every native version-manager dir ahead of the native system block, in the native order. All six new assertions go RED when the system block is hoisted first or the guest list drifts (verified by reverting the ordering).Not done, deliberately: an identity check on the resolved binary (
--versionsniff, shebang read) before spawning. Every spawn site here already runs the tool and surfaces its failure, a probe would cost a process launch per resolution on a path that exists to be cheap, and the packaged app has spawned from exactly these dirs via the PATH seed for months without one. Ordering, not identity, is the guard.WSL guests get six extra
[ -d ]-guardedPATHentries (/snap/bin,/home/linuxbrew/.linuxbrew/bin,/nix/var/nix/profiles/default/bin,$HOME/.nix-profile/bin,$HOME/.opencode/bin,$HOME/.vite-plus/bin), appended not prepended, per that file's own rule.Plus one ordering change to an existing entry, stated explicitly:
"/usr/local/bin"moved from before"$HOME"/.nvm/versions/node/*/binto after it, so the guest ranks version-manager dirs ahead of system ones the way the native lists do. Bounds on it: the whole prelude is appended behind a resolved loginPATH, so it can only re-rank a command the loginPATHdid not contain at all and which exists in two different fallback dirs; and both consumers (detectWslCommandsOnPath, which discards the resolved path and returns only command names, andrunPreflightCommandInWsl, used byisCommandAvailable/isCommandOnPath) test presence, not identity. It is also not full parity, and the docstring no longer claims it is: a shell glob expands lexicographically, whereas nativegetNvmVersionDirectoriesorders nvm dirs default-alias-first for [Bug]: CLI agents crash afternvm install <newer>— Orca picks newest nvm node for PATH but spawns CLIs from older nvm node (ABI mismatch) #10932 reasons a glob cannot reproduce.Latency: up to 7 extra
statSyncprobes per unresolved command, only on the PATH-miss path. Immeasurable next to the 10s login-shell probe this backstops.Windows:
getSystemCliInstallDirectoriesreturns[]onwin32; the Windows branch is unchanged and pinned by a test.Remote wire: none. No RPC params, stream frames, or published content change;
KNOWN_TUI_AGENT_DETECTION_COMMANDSandresolveDetectedTuiAgentIdsare untouched, so the set of agent ids a host can publish to an older client is unchanged — only which subset a given machine reports.SSH hosts get nothing from this change — stated as a correction, with the reasoning itself corrected. An earlier revision claimed "a remote host runs its own copy of this code". It does not.
detectRemoteAgents(src/main/preflight/agent-detection.ts:241-252) sendspreflight.detectAgentswith acommandsparam, and the handler for that param issrc/relay/preflight-handler.ts:48→detectAgents(:57) →isCommandOnPath(:122-123) →isCommandOnPathForRelay(:171-195), which runswhere.exeon win32 or a trusted POSIX login shell and never callsresolveCliCommands/getSystemCliInstallDirectories. The otherpreflight.detectAgents(src/main/runtime/rpc/methods/preflight.ts:28,params: null) is the client's runtime perdocs/reference/ssh-execution-boundary.md, i.e. a packaged desktop already covered by the PATH seed.A second correction, from round 5: the previous revision justified the unreachability with "the relay is a separate esbuild bundle (
config/tsconfig.relay.jsonincludes only../src/relay/**/*plus twosrc/main/ptyfiles), so it cannot reach this module at all." That inference was invalid —src/relayimports ~160 files' worth ofsrc/shared/*modules despite thatincludelist, because a tsconfigincludedoes not bound esbuild's import graph. The conclusion survives, but on evidence rather than inference: a transitive walk from all 182 non-testsrc/relay/*.tsfiles reaches 884 modules and none ofnode-cli-command-resolution.ts,system-cli-install-dirs.ts, orposix-version-manager-bin-dirs.ts(output under Fix evidence). Residual risk, unguarded: that walk is a one-time manual check, not a test. A future relay file importing any shared module that transitively pulls in the resolver would silently falsify this bullet with every suite still green — Follow-up Fix update checker 406 error and add menu feedback #8.The relay's login-shell lookup still has no install-dir fallback of any kind; that gap is untouched here and is Follow-up Improve terminal font rendering, per-pane zoom, and UI zoom #7.
Newly-swallowed errors: none. No
catchwas added or widened.Folder workspaces vs git worktrees: irrelevant to this path; it never touches repo layout.
Honest cost: this ships a small, demonstrably-correct list fix whose field impact is unproven and, per the telemetry above, probably small. Reports Linux support #1, Fix Ctrl+Backspace not deleting word in terminal #2 and Add Ctrl+Click to open links in terminal #4 in the G6 bucket are untouched.
Adversarial review
5 rounds total; converged clean = true at round 5. Round 5 returned no blocking findings, having re-run every piece of evidence in this body from scratch rather than reading it. Rounds 1-4 produced 7 blocking findings; all 7 were accepted, none was rebutted. Six were fixed in code or in claims; one — the unproven link to the field report — is carried as an explicit disclosed limitation with G6 report #3 left open, because no code on this branch can close it. Round 5's top-ranked non-blocking finding was a live claim defect in this body and is fixed in this revision (details below); it is the reason the Trade-offs → SSH hosts bullet now argues from an import walk instead of from a tsconfig
include.Round 1 — 2 blocking, both accepted, neither rebutted.
patchPackagedProcessPathseeds those exact dirs ontoprocess.env.PATHfor every packaged posix run, before detection, test-pinned atconfigure-process.test.ts:75/76/97/98. Fixed by rewriting the commit message (and this PR body) to state where the fallback is actually decisive — theorcaCLI, dev runs, WSL guests — and to say explicitly that G6 report Add Shift+Enter to insert newline in terminal #3 stays open./opt/homebrewis macOS-only; Linuxbrew is/home/linuxbrew/.linuxbrew/bin, and/snap/binand the nix prefixes were missing too — all four already seeded byconfigure-process.ts:140-147. Fixed by adding them to both the fallback list and the WSL prelude, rather than by narrowing the claim.Round 1 also confirmed the evidence independently: the reviewer reverted the production files, reproduced the identical red output, restored, and re-ran 10,950 tests across the affected areas clean. "The test is not theatre."
Round 2 — 1 blocking, accepted; process finding, not a code defect.
The handoff summary given to the reviewer described a 2-file / +38 line change with 3 new macOS dirs, while HEAD was 4 files / +227 with 6 lookup dirs plus WSL-prelude entries, the function had moved into a new module, and the quoted failing test names no longer existed — all consequences of the round-1 fixes, but never restated. The reviewer's point was that a decision record authorizing "+38, 3 dirs" cannot authorize something 6× larger that also changes Linux and WSL-guest resolution. Fixed by restating the claims against HEAD (this PR body is written against HEAD, verified by re-running everything above myself).
Round 2's non-blocking findings drove the second commit: (a) the three lists disagreed on order while claiming to be kept in step, so a CLI present in both
/usr/local/binand/snap/bincould resolve to a different binary than the seeded PATH scan found — all three now share the seed's relative order, pinned by a duplicate-install test and an offset assertion; (b) the parity docstring's claim was false — it also omitted~/.vite-plus/binand/opt/homebrewoff darwin, all three gaps then named as deliberate — round 4 showed the~/.vite-plus/binone was not deliberate but wrong, and it is now closed; (c) thedetectCommandsInInstallDirscase read the ambientprocess.env.PATH, so on a box with/usr/local/binon PATH it wasn't exercising the fallback — it now stubs a GUI-launch PATH; (d) the test built paths with hostjoinso it holds on a Windows dev machine.Round 3 — 2 blocking, both accepted, neither rebutted.
The claims/evidence block handed to the reviewer described
HEAD~2, notHEAD, in six specific ways — a 2-file/+38 stat against a 4-file/+273 change;getSystemCliInstallDirectoriescited atnode-cli-command-resolution.ts:124-146when it lives insrc/shared/system-cli-install-dirs.ts; 3 claimed lookup dirs against 6 across two platforms; the WSL prelude described as a single added entry; "6 cases / 3 failed | 3 passed" against a file with 8; and a blanket "no existing resolution can change" that the WSL/usr/local/binmove contradicts. Round 2 had raised the same class of defect and the restatement never reached the round-3 input. Accepted. The stale artifact is retired: this body is the record, and every number in it is re-derived at HEAD2666af8(git diff --stat origin/main...HEAD= 5 files, +339/-5; prod 3 files, +89/-5; test 2 files, +250), the function is cited at its real path, all eight dirs are enumerated, the eight test cases and their real names are quoted from a run performed for this revision, and the "nothing can resolve differently" claim is scoped to the native resolvers with the WSL ordering change spelled out in Trade-offs. No code change was invented to satisfy it — it was a claims defect and it got a claims fix.The branch does not fix the report it is filed under, confirmed independently by the reviewer rather than taken from the author's disclaimer:
patchPackagedProcessPathseeds all of them atmain-process-preflight.ts:147before detection,mergePathSegmentsnever removes them, and on posixbuildLocalPreflightEnv()returnsundefined, so the packaged macOSPATHscan reads the seeded env and this fallback is never consulted for those dirs. Accepted as a disclosed limitation, not remediable by code on this branch: it is stated in Scope honesty, stated up front, in What is NOT proven, and in Follow-up Linux support #1, and G6 report Add Shift+Enter to insert newline in terminal #3 stays open. Round 3's verdict named three beneficiary populations as the merge basis —orcaCLI, unpackaged/dev runs, "and the SSH-host runtime that servespreflight.detectAgents". Round 4 falsified the SSH third of that sentence, so the merge basis is noworcaCLI + unpackaged/dev runs + WSL guests.Round 3 also confirmed the evidence independently: it exported
origin/mainwithgit archive, added only the test file, and got 5 failed / 3 passed (8), then 8 passed at HEAD — "the test is not theatre" — and re-derived the ordering safety and the win32/SSH/folder-workspace/remote-wire angles by hand.Its non-blocking findings drove the third commit (
bcd5948), all three accepted:(a) the new docstring's ordering-parity claim was false across the version-manager/system block boundary —
claudein both~/.local/binand/opt/homebrew/binresolves to~/.local/binvia the fallback but/opt/homebrew/binvia the seededPATH, because~/.local/bincomes fromgetBaseVersionManagerDirectories, which leads. The claim is now scoped to within the system block and the gap is named, not asserted away; it is left unclosed on purpose, since closing it means hoisting a system dir over a version-manager one (#18234).(b) the WSL reorder's justification ("a version manager still wins in the guest, as it does natively") was wrong, because a shell glob expands lexicographically while native orders nvm dirs default-alias-first (#10932). Docstring corrected and the move recorded as this file's one behavior change, with its bounds.
(c) the #18234 seed-leak guard asserted only 2 of the 6 new dirs were absent from
getVersionManagerBinPaths. It now spells out all eight across darwin and linux — spelled out rather than derived fromgetSystemCliInstallDirectories, which would pass vacuously against exactly the refactor it guards.Round 4 — 2 blocking, both accepted, neither rebutted.
The docstring and Follow-up Add Shift+Enter to insert newline in terminal #3 claimed — "verified by enumerating
getTuiAgentDetectionProbeCommands" — that~/.vite-plus/binmaps to no probed agent command. False, and the repo says so:src/shared/tui-agent-config.ts:137definespi: { detectCmd: 'pi' }with nodetectUnsupportedRuntimes, soKNOWN_TUI_AGENT_DETECTION_COMMANDSyieldspion every runtime, andconfigure-process.ts:155-156+configure-process.test.ts:71-73document~/.vite-plus/binas the Pi installer's location whose absence makes Orca report Pi "Not installed". The branch had added one of the two [Bug]: OpenCode and PI CLI not detected #829 dirs and skipped the other on a false premise, in the native fallback and the WSL prelude alike. Fixed in code (2666af8), not by narrowing the claim:~/.vite-plus/binis now ingetSystemCliInstallDirectoriesandPOSIX_VERSION_MANAGER_BIN_DIRS, with apicase in the detection test that goes red against the previous HEAD (evidence above).The body named "the SSH host runtime that answers
preflight.detectAgentson the remote side" as a beneficiary and asserted "a remote host runs its own copy of this code". Neither holds. Accepted; fixed as a claims defect — the SSH leg is retracted in Scope honesty and replaced by a positive statement of what actually runs there in Trade-offs → SSH hosts, with the relay's missing fallback recorded as Follow-up Improve terminal font rendering, per-pane zoom, and UI zoom #7. The claim had been imported verbatim from round 3's note rather than re-derived. The shipping beneficiary set is now stated asorcaCLI invocations with a degraded PATH, plus unpackaged/dev runs, plus WSL guests via the prelude.Round 4 also confirmed the evidence independently a second time (clean
git archiveoforigin/main+ the test file alone: 5 failed / 3 passed of 8; 8/8 at HEAD), re-derived the append-last ordering safety and thegetVersionManagerBinPathsunreachability by hand, and confirmedwin32returns[]. Its non-blocking findings drove the rest of2666af8: the seed-order guard now derives its expected order fromgetSystemCliInstallDirectoriesinsideconfigure-process.test.ts(so reordering either list fails, where before both were hardcoded copies);/snap/bin+ Linuxbrew now gate onlinuxexactly like the seed instead of every non-darwin posix; the/opt/homebrew-off-darwin gap is restated without the claim the seed contradicts; and the "lookup-only" paragraph now names thewithCliRuntimeOnPathprepend exception that the body already disclosed.Round 5 — 0 blocking; converged clean. Every attack failed on re-execution, and one non-blocking claim defect was found in this body and is fixed here.
Round 5 explicitly re-ran the evidence rather than reading it: reverting the production hunks to
origin/mainreproduced 5 failed | 3 passed (8) byte-matching the quoted output including the assertion diffs; restoring gave 8/8; the round-4HEAD~1experiment reproduced 3 failed | 5 passed (8) with the sameSet{'codex','opencode'}vsSet{'codex','opencode','pi'}diff. Both typechecks exit 0, oxlint on all 5 changed files exits 0, the changed-code quality gate reports 0 findings, and the 7-file / 161-test blast radius passes. A full run ofsrc/shared src/main/startup src/cli src/main/ipc src/main/preflight src/main/agent-hooksgave 12,670 passed with one failure,src/shared/remote-runtime-shared-control-connection.test.ts:652— a known load-sensitivevi.waitForflake that passes 28/28 in isolation and lives in a module this diff does not touch. It also strengthened the scope disclaimer independently by readingv1.4.194(see Scope honesty) and confirmed there is noFixes #/Closes #/Resolves #keyword in the body or in any of the four commits. I re-ran all of the above myself before publishing this revision; results are quoted verbatim under Fix evidence.Round 5's non-blocking findings, and what happened to each:
config/tsconfig.relay.jsonincludes only../src/relay/**/*plus twosrc/main/ptyfiles), so it cannot reach this module at all." That inference is invalid —src/relayimportssrc/shared/*in ~160 files despite thatincludelist, so a tsconfigincludedoes not bound esbuild's import graph. This is the same defect class as rounds 1-4: a claim asserted from evidence that does not support it, in a fix for exactly that defect class. The conclusion is nonetheless true, and round 5 proved it with a transitive import walk, which I reproduced (884 modules reached from 182 relay files; the resolver is not among them). The bullet now argues from that walk. Its residual risk — nothing guards the property, so a future relay import could silently falsify it with all suites green — is now disclosed in the bullet and tracked as Follow-up Fix update checker 406 error and add menu feedback #8 rather than left implicit.PATHwith no seed, which no packaged build has. Accepted; it is not cited as support anywhere, and it is now explicitly withdrawn under What is NOT proven rather than merely absent.Not taken, from earlier rounds, with reasons:
configure-process.ts's seed,system-cli-install-dirs.ts, andPOSIX_VERSION_MANAGER_BIN_DIRSremain three hand-maintained literals, which is real duplication under AGENTS.md "Reuse Before Reimplementing". Deferred to Follow-up Fix PTY listener leak, use local restty with selection support #5 because the fix is a refactor of a startup-critical PATH seed, not an edit to this diff; the drift it enables is currently caught by the order-parity test inconfigure-process.test.ts, which derives its expectation fromgetSystemCliInstallDirectories./opt/homebrew/binoff darwin (round 4 non-blocking). Deliberate: a Linux brew install lands in the Linuxbrew prefix, which is covered, so the seed's/opt/homebrew/binentry is a phantom stat on Linux. Round 4 correctly noted the seed and the fallback therefore disagree on this one dir; the disagreement is stated in the docstring rather than asserted away, and the residual effect is that a Linux user who manually installed to/opt/homebrew/binis still under-detected by the fallback. Pinned as intended byagent-cli-install-dir-fallback.test.ts.Follow-ups
detectInstalledAgents' per-commandinstalledOnPathresult plus the effectiveprocess.env.PATH, since the seed makes the current hypothesis untestable from telemetry alone.getSystemCliInstallDirectoriesreturns[]onwin32, andpatchPackagedProcessPath's system block is POSIX-only, so%USERPROFILE%\.opencode\binand npm's Windows global prefix have never had coverage in either list. Pre-existing and deliberately unchanged here; worth its own ticket.Withdrawn as false and fixed in~/.vite-plus/binis omitted from the fallback list; no probed agent command maps to it.2666af8.piis a probed detect command on every runtime (src/shared/tui-agent-config.ts:137, nodetectUnsupportedRuntimes), and~/.vite-plus/binis the Pi installer's default —configure-process.test.ts:71-73documents both~/.opencode/binand~/.vite-plus/binas the [Bug]: OpenCode and PI CLI not detected #829 install locations. Both are now ingetSystemCliInstallDirectoriesandPOSIX_VERSION_MANAGER_BIN_DIRS, pinned by thepicase inreports a system-installed CLI as detected, not just resolved.~/.local/binprecedes the system dirs in the fallback but follows them inpatchPackagedProcessPath's seed, so a CLI installed in both~/.local/binand a Homebrew prefix resolves differently through the two paths. Pre-existing, documented insystem-cli-install-dirs.ts, and deliberately not closed here — the only fix is to re-rank a version-manager dir against a system one, which is the [Bug]: gh api user/starred child processes spin at 100% CPU indefinitely and are respawned continuously #18234 defect class.configure-process.ts's seed,system-cli-install-dirs.ts, andPOSIX_VERSION_MANAGER_BIN_DIRSare three hand-maintained literals (the two native resolvers now share one,getCliInstallDirectories, and a derived test checks the guest prelude against the native lists, so drift between native and WSL fails a test rather than shipping — but the seed is still a separate literal). Deriving all three from one source (with per-platform and prepend/append policy as parameters) would remove the whole class of drift these commits fixed.isCommandOnPathForRelay(src/relay/preflight-handler.ts:171) asks a login shell orwhere.exeand stops; if that shell's PATH misses a Homebrew/snap/nix/installer-owned agent, the remote host reports it missing with no backstop. Closing it means either giving the relay bundle its own copy of these dirs or having the client send them — a wire change, so capability-negotiated perdocs/reference/remote-wire-compatibility.md. Out of scope here; worth its own ticket.config/scripts/check-runtime-electron-ratchet.mjs— assertsrc/shared/node-cli-command-resolution.tsis absent from the relay bundle's import graph — would convert it from a claim into an invariant. Until then, a future relay import can falsify that bullet with every suite green.