Repository navigation
Conversation
|
I have read the CLA Document and I hereby sign the CLA |
|
I have read the CLA Document and I hereby sign the CLA curtp seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Fixes #4180.
What
Expand the Windows DEFAULT_ENV_VARS list so MCP servers inherit COMSPEC, SYSTEMROOT, PROGRAMDATA, APPDATA, and other core variables used by CLI helpers and DNS
add a Windows-only regression test (test_create_env_for_mcp_server_includes_windows_defaults) that guards each entry in that list
keep the existing override test working cross‑platform by reading USERNAME on Windows
Why
Without those inherited variables, Windows MCP servers that shell out (Docker MCP gateway, npx-based servers, etc.) fail immediately because plugins, caches, or system DLLs can’t be located. The new test ensures we don’t regress on the required variable set.
How
Update codex-rs/mcp-client/src/mcp_client.rs
Introduce EnvVarGuard to safely mutate/restore env vars during tests
Document the rationale in the inline comment
Testing
just fmt
cargo test -p codex-mcp-client
just fix -p codex-mcp-client