Skip to content

fix(agent-detection): trust a WSL share path's distro in the agent list, over Orca's cached distro list - #28233

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/conv-c1-s2-wsl-path-distro
Oct 14, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/conv-c1-s2-wsl-path-distro

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2

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.

  • A distro installed after Orca started: before, the agent list shows the repair state; after, it lists the agents installed in that distro.
  • A distro that was really removed: before, the repair state; after, no agents (the probe finds nothing).
  • A project explicitly set to a WSL distro: unchanged, still checked against the list.

Mechanism. local-project-runtime-resolution.ts: resolveLocalWorkspaceRuntime drops the temporary trustsWslPath parameter, 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.exe call 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: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.

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

  • SSH: unchanged (a remote worktree's agent list is probed on its host).
  • Wire: no change.

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

@brennanb2025
brennanb2025 marked this pull request as ready for review October 13, 2026 10:37
@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-s1-repair-refusal to main October 14, 2026 04:46
…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.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/conv-c1-s2-wsl-path-distro branch from 59757ca to 759ffe2 Compare October 14, 2026 04:49
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0410024f-b4a4-45b7-bf8f-6a6a7203bcce
📥 Commits

Reviewing files that changed from the base of the PR and between 126009d and 759ffe2.

📒 Files selected for processing: 2
  • src/main/local-project-runtime-resolution.ts
  • src/main/preflight/workspace-agent-detection.test.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.

📝 Walkthrough

The local workspace runtime resolver no longer accepts a trusted-path option. WSL-share paths bypass cached WSL availability and distro checks when no project runtime preference is set. The launch-scope resolver calls the updated function without the removed argument. The test now expects the distro inferred from the path when the cached distro list contains a different distro.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 759ff

Inferred WSL-share paths no longer depend on stale cached distro data, while unavailable distros still produce no detected agents. Explicitly configured distro checks and existing launch behavior remain intact; no material merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: WSL share paths now trust the path's distro over Orca's cached distro list during agent detection.
Description check Passed The description is complete and focused. It explains the problem, user-visible behavior before and after, implementation mechanism, rationale, testing, scope, and compatibility considerations. The Lin…
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.
  • 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.

@brennanb2025
brennanb2025 merged commit 5e1c117 into main Oct 14, 2026
33 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/conv-c1-s2-wsl-path-distro branch October 14, 2026 05:48
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