Repository navigation
Conversation
These two sites make opposite mistakes, and neither is reviewable against the other: - `preflight-wsl-agent-detection.ts` ran `buildWslLoginShellCommand` -- the *uncaptured* variant -- and parsed stdout. An interactive login shell runs the distro rc, and stock Ubuntu writes its "run a command as administrator" hint to stdout, so detection was parsing a stream with a banner in front of it. - `skill-wsl-provider-detection.ts` ran a bare `sh -c` with no login shell at all, so a codex/claude installed through nvm or mise was never on PATH and read as absent. Both want the same thing: the user's real login PATH, without a shell in the loop. That is the probe lane -- the PATH comes from one cached login-shell probe per distro, and no shell runs on the call itself, so there is no banner to strip and no `~/.profile` to stall behind (#9725, #7563, #8366). Also removes the hand-rolled Promise.race timeout in the preflight file; `runProcess` already bounds the child and escalates to SIGKILL. Allowlist: 23 -> 21.
This was referenced Aug 22, 2026
Contributor
Author
|
Folded into #15915, which carries the same content plus three rounds of review fixes on one branch that is green on its own. The stacked branches predated those fixes, so each was red in isolation — collapsing was safer than four-way branch surgery. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #15903. Allowlist 23 → 21.
ELI5
Two bits of code both ask WSL "is the Claude/Codex CLI installed?" One asks in a way that gets a banner mixed into the answer. The other asks in a way that can't see tools installed via nvm. Both now ask the same, correct way.
Why these two first
They're worth reading together because they make opposite mistakes.
ipc/preflight-wsl-agent-detection.ts:60ranbuildWslLoginShellCommand— the uncaptured variant — and parsed stdout. An interactive login shell runs the distro rc, and stock Ubuntu writes "run a command as administrator" to stdout. Detection was parsing a stream with a banner in front of it.skills/skill-wsl-provider-detection.ts:13ran a baresh -cwith no login shell at all, so acodex/claudeinstalled through nvm or mise was never on PATH and read as absent.Two adjacent paths, opposite causes, neither reviewable against the other. Both are mechanisms for #9725, #7563, #8366 — "agent detection fails while the same command works by hand".
What changes
Both move to
lane: 'probe': PATH and HOME come from one cached login-shell probe per distro, and the call itself runs no shell. No banner to strip, no~/.profileto stall behind.Also drops a hand-rolled
Promise.racetimeout in the preflight file. It existed becauseexecFile's timeout doesn't fire if the child wedges before spawn completes;runProcessbounds the child and escalates to SIGKILL, so the race is now redundant rather than merely duplicated.Proof of no regression
preflight-wsl-agent-detection.test.tsrewritten onto the runner mock, plus a regression test that puts Ubuntu-shaped banner noise immediately ahead of the payload and asserts detection still succeeds.skill-wsl-provider-detection.test.tsis new — the file had no unit test at all — asserting the probe lane, which is what makes a PATH-only install visible.runProcessresolves on both, so this had to be explicit.User-facing trade-offs
None. Both paths get strictly more accurate: the banner can no longer corrupt a result, and an nvm/mise-installed agent is now found where it previously read as missing.