mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Strengthen Agent Plugin MCP environment overlay tests (#40410)
## What changed - Cover forwarding a legacy `env_vars` entry when the portable MCP server has no `env` map. - Use the test workspace variable instead of `PATH` in the stdio round-trip test, keeping overlay forwarding distinct from portable environment expansion. GitOrigin-RevId: c5cfb333e553581fc856d43a04e5be0abd9f65ef
This commit is contained in:
@@ -116,7 +116,7 @@ async fn agent_plugin_codex_mcp_overlay_only_forwards_matching_stdio_server_env_
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn agent_plugin_codex_mcp_overlay_supports_inline_legacy_servers() {
|
||||
async fn agent_plugin_codex_mcp_overlay_supports_inline_legacy_servers_without_portable_env() {
|
||||
let temp_dir = TempDir::new().expect("tempdir");
|
||||
let plugin_root = temp_dir.path().join("plugin");
|
||||
write_file(
|
||||
@@ -130,8 +130,7 @@ async fn agent_plugin_codex_mcp_overlay_supports_inline_legacy_servers() {
|
||||
"mcpServers": {
|
||||
"shared": {
|
||||
"type": "stdio",
|
||||
"command": "portable-server",
|
||||
"env": {"TOKEN": "${TOKEN}"}
|
||||
"command": "portable-server"
|
||||
}
|
||||
}
|
||||
}"#,
|
||||
@@ -139,13 +138,12 @@ async fn agent_plugin_codex_mcp_overlay_supports_inline_legacy_servers() {
|
||||
|
||||
let mut expected = load_plugin_mcp_servers(&plugin_root, /*auth_mode*/ None).await;
|
||||
let Some(McpServerConfig {
|
||||
transport: McpServerTransportConfig::Stdio { env, env_vars, .. },
|
||||
transport: McpServerTransportConfig::Stdio { env_vars, .. },
|
||||
..
|
||||
}) = expected.get_mut("shared")
|
||||
else {
|
||||
panic!("expected portable stdio server");
|
||||
};
|
||||
env.as_mut().expect("portable environment").remove("TOKEN");
|
||||
env_vars.push("TOKEN".into());
|
||||
|
||||
write_file(
|
||||
|
||||
Reference in New Issue
Block a user