Skip to content

fix: restore PATH/PATHEXT after spreading the provider environment - #1

Merged
wrfgup merged 1 commit into
wrfgup:mainfrom
surelykidding:fix/provider-env-path-casing
Oct 1, 2026
Merged

wrfgup merged 1 commit into
wrfgup:mainfrom
surelykidding:fix/provider-env-path-casing

Conversation

@surelykidding

Copy link
Copy Markdown

Windows stores the search path in the environment block as mixed-case Path. process.env.PATH resolves case-insensitively, but localAgentProviderEnvironment builds each provider's env with a spread, which copies only the original key casing. Every consumer that later reads env.PATH from that plain object gets undefined: the availability walk reports codex/grok as "executable not found" on the startup banner, and the Codex driver's resolveCodexCommand fails before inference with PROVIDER_UNAVAILABLE: Codex executable was not found. — while the same probe succeeds from any shell that exports an uppercase PATH (e.g. Git Bash), so it only bites standard Windows service environments such as a cmd-launched MCP server.

The fix restores the canonical PATH and PATHEXT keys after the spread, sourcing values from any casing present in the inherited env and never overwriting an existing key. A regression test covers a Path-only inherited env, and I verified end-to-end in a child process whose environment block contains only Path that provider driver resolution now finds the codex executable (it returned undefined before).

On Windows the environment block stores the search path as mixed-case
"Path". process.env.PATH resolves case-insensitively, but
localAgentProviderEnvironment builds the per-provider env with a spread,
which copies only the original key casing. Consumers then read env.PATH
on a plain object, get undefined, and both the availability walk and the
Codex driver's executable resolution report "executable not found" --
while the same probe succeeds from shells that export an uppercase PATH.

Restore the canonical PATH/PATHEXT keys after the spread, from any
casing present in the inherited env, without overwriting existing keys.
@wrfgup
wrfgup merged commit a635df3 into wrfgup:main Oct 1, 2026
FJ-double pushed a commit to FJ-double/taskquay that referenced this pull request Oct 16, 2026
Add single-user OAuth for DevSpace MCP
FJ-double pushed a commit to FJ-double/taskquay that referenced this pull request Oct 16, 2026
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.

2 participants