Skip to content

test(wsl): find the chat lane's claude on the guest PATH, with a Windows-side decoy - #34551

Merged
nwparker merged 2 commits into
mainfrom
nwparker/wsl-chat-lane-path-discovery
Oct 27, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/wsl-chat-lane-path-discovery

Conversation

@nwparker

@nwparker nwparker commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​130 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108

ELI5

The real-WSL test lane already proves that a native Claude chat runs inside a WSL distro through the WSL host's server. But it told the server exactly which claude to run, so it never checked whether the server can find a user's own install. This PR removes that shortcut, so the server has to find claude the way it would for a real user. It also puts a fake Windows-side claude where WSL exposes Windows programs, to check that the Windows one never gets used by mistake.

What Changed

Test-only: lane test code that wsl-orcad-e2e.yml already runs. The workflow file itself is unchanged, and nothing that ships changes.

  • Guest install: the lane no longer sets a Command override for claude. The fixture CLI is installed as ~/orca-lane-chat-bin/claude, and the launch phase puts that directory first on PATH in the login profile, next to the existing SSH_AUTH_SOCK export. Each chat now asserts two things: the provider's script is the guest fixture, and the wrapper that launched it is the guest claude.
  • Windows-side decoy: before anything spawns, the lane writes an npm-style claude shell shim into its own Windows work directory and puts that directory on its own PATH. The orcad launch passes process.env through, so WSL appends that directory to orcad's PATH as /mnt/c/.... The same thing happens to a real user's %APPDATA%\npm. The shim records every run in a guest marker file.
  • After both chats (git and folder): the lane first proves the decoy is reachable. Its directory must be on orcad's own PATH (read from /proc/<orcad>/environ), and invoking it by that full /mnt/... path from the guest must run it. That invocation uses a scratch HOME, so it doesn't touch the marker. Only then does the lane assert the decoy never ran. It then deletes the guest claude and calls agentSession.createSupport until either the decoy runs or 60 s pass. It records the result in the receipt as <distro>.chat.windowsOnly: the admission answer and any decoy runs, with the arguments of each run. This step only records; it doesn't assert. Errors from the RPC or guest commands are caught and recorded under errors, so the probe can't fail the lane.

Why

The plan for native chat on WSL hosts needs to know whether a Windows-only install leaks into the distro's chat. If it does, the next PR adds a guard on the host that filters WSL's interop PATH entries. That PR will turn the recorded probe into an assertion. Recording first lets this PR's lane run answer the question without going red. Writing the decoy into the runner's own work directory keeps it out of real Windows install locations.

Linked Issue

N/A (maintainer).

Visual Proof

N/A: test-only, no UI.

Testing

  • pnpm tc, pnpm run typecheck:ci, pnpm run check:code-quality:changed and oxlint pass locally.

  • The lane only runs on Windows with WSL. This PR's WSL orcad E2E run is the proof, and its receipts artifact carries windowsOnly.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Flag-off / user risk: none. Only test files and the lane change; no shipped code.

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

Cross-platform: the lane runs only on Windows CI. The decoy is written under the lane's own work directory.

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

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 98e808bc-be71-4c9e-9c1f-b80f7aad5f62
Commits

Reviewing files that changed from the base of the PR and between 84decfd and 58494b5.

Files selected for processing: 4
  • src/main/wsl/wsl-orcad-chat-provider-fixture.ts
  • src/main/wsl/wsl-orcad-chat-windows-decoy.ts
  • src/main/wsl/wsl-orcad-real-distro-lane.test.ts
  • src/main/wsl/wsl-orcad-structured-chat-contract.ts

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

Walkthrough

The WSL chat fixture now places Claude in a guest PATH directory and returns its script and CLI paths. The integration test adds a Windows-side Claude decoy and checks candidate reachability, provider report values, decoy invocations, and a Windows-only support-session probe.

Priority: Low

Merge Risk: Minimal · up to 58494

The test-only change is mergeable after normal checks. The Windows-with-WSL lane result has not been supplied, so its runtime resolution outcome remains unconfirmed.

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. Documentation-only edits and deletions within surv… 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 summarizes the main test change: resolving the guest PATH Claude executable while guarding against a Windows-side decoy.
Description check Passed The description follows the required template and explains the change, rationale, testing, scope, cross-platform considerations, and checklist status. The maintainer exception supports the N/A linked …
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.
Full details: Description check

Explanation

The description follows the required template and explains the change, rationale, testing, scope, cross-platform considerations, and checklist status. The maintainer exception supports the N/A linked issue entry.

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. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 4 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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.

@nwparker
nwparker merged commit 5a29a68 into main Oct 27, 2026
46 checks passed
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