fix(windows): strip quotes from repaired PATH - #209
Conversation
(cherry picked from commit 12fe2d6d03062c5d7fc3beff168f8c4af1235b50)
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Review follow-ups on the #8746 port. Stripping quotes from each segment after splitting on the raw delimiter destroyed entries that legitimately contain one: PATH=C:\bin;"C:\my;dir";C:\other previously survived byte-for-byte and now became four entries, dropping the real directory and adding a relative "dir" resolved against the child process's cwd. The split honours quoting, and an entry containing the delimiter is re-quoted on the way out so consumers do not split it apart again. Unbalanced quotes fall back to a plain split, since those are stray characters rather than quoting. Stripping also left degenerate fragments: C:" became C:, a drive-relative entry that made spawned providers search the child's own directory. Those are dropped. Both copies of the helper stay in sync.
|
Adversarial review confirmed the core change is correct and that dedupe behaviour is unchanged (
Re-verified: Still not verified on a Windows host — this machine is macOS. The unit tests cover both cases. |
On Windows a
PATHrepaired from the registry can contain quoted segments. Pylonkept the quotes when splitting and rejoining, so the resulting entries did not
resolve and provider CLIs looked missing on machines whose PATH happened to be
quoted.
Quotes are now stripped from each segment as PATH is normalized, in both the
shared helper and the desktop shell environment.
Adopted from upstream
pingdotgg/t3code#8746(12fe2d6d0), cherry-picked clean.packages/shared/src/shell.tswas identical to the upstream base; Pylon'sdivergence in
DesktopShellEnvironment.tsis in unrelated hunks.Verified:
vp test run --dir packages/shared packages/shared/src/shell.test.ts(30 passed) and
vp test run --dir apps/desktop apps/desktop/src/shell/DesktopShellEnvironment.test.ts(15 passed).
Not verified on a Windows host — this machine is macOS. The change is exercised by
the unit tests above, which cover the quoted-segment cases.
Reviewed and integrated with Claude Opus 5 in Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.