Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01e0584979
ℹ️ 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let new_path = env::join_paths( | ||
| std::iter::once(prefix.as_os_str()).chain(parts.iter().map(|path| path.as_os_str())), | ||
| ) | ||
| .map_err(|err| anyhow!("failed to construct PATH: {err}"))?; |
There was a problem hiding this comment.
Handle quoted PATH entries when prepending denybin
env::join_paths makes this PATH rewrite fallible on Windows: Rust returns Err if any existing PATH component contains a double quote. That matters here because apply_no_network_to_env() is called from run_windows_sandbox_capture(), so a machine with a quoted PATH entry (for example, some installers add quoted Program Files paths) will now fail the entire no-network sandbox launch before the command starts. The previous string concatenation preserved the user's PATH verbatim instead of aborting.
Useful? React with 👍 / 👎.
6f8bf17 to
72fd48e
Compare
14afae1 to
f1c4ba1
Compare
Why
This is a follow-up to #15360. That change fixed the
arg0helper setup, butrmcp-clientstill coerced stdio transport environment values into UTF-8Strings before program resolution and process spawn. IfPATHor another inherited environment value contains non-UTF-8 bytes, that loses fidelity before it reacheswhichandCommand.What changed
create_env_for_mcp_server()to returnHashMap<OsString, OsString>and read inherited values withstd::env::var_os()TransportRecipe::Stdio.env,RmcpClient::new_stdio_client(), andprogram_resolver::resolve()to keep stdio transport env values inOsStringform withinrmcp-clientcodex-coreconfig boundary stringly, but convert configured stdio env values toOsStringonce when constructing the transportOsStringenv mapscreate_env_for_mcp_server()preserves a non-UTF-8PATHHow to verify
cargo test -p codex-rmcp-clientcargo test -p codex-core mcp_connection_managerjust argument-comment-lintTargeted coverage in this change includes
utils::tests::create_env_preserves_path_when_it_is_not_utf8, while the updated stdio transport path is exercised by the existing rmcp-client tests that constructRmcpClient::new_stdio_client().