[codex] Reuse Apps MCP path override for plugin-service rollout (#22527)

## Summary
- reuse `apps_mcp_path_override` for the plugin-service rollout,
defaulting enabled boolean overrides to `/ps/mcp` while preserving
explicit configured paths

## Validation
- `just write-config-schema`
- `just fmt`
- `cargo test -p codex-mcp`
- `cargo test -p codex-core apps_mcp_path_override`
- `cargo test -p codex-core
to_mcp_config_preserves_apps_feature_from_config`
- `cargo test -p codex-features`
This commit is contained in:
Alex Daley
2026-05-13 15:18:35 -04:00
committed by GitHub
parent c9edb26755
commit a98b57d065
2 changed files with 53 additions and 0 deletions

View File

@@ -8769,6 +8769,58 @@ path = "/custom/mcp"
Ok(())
}
#[tokio::test]
async fn config_defaults_enabled_apps_mcp_path_override_to_plugin_service() -> std::io::Result<()> {
let codex_home = TempDir::new()?;
let toml = r#"
model = "gpt-5.4"
[features]
apps_mcp_path_override = true
"#;
let cfg: ConfigToml =
toml::from_str(toml).expect("TOML deserialization should succeed for apps MCP feature");
let config = Config::load_from_base_config_with_overrides(
cfg,
ConfigOverrides::default(),
codex_home.abs(),
)
.await?;
assert!(config.features.enabled(Feature::AppsMcpPathOverride));
assert_eq!(config.apps_mcp_path_override.as_deref(), Some("/ps/mcp"));
Ok(())
}
#[tokio::test]
async fn config_preserves_explicit_apps_mcp_path_override_path() -> std::io::Result<()> {
let codex_home = TempDir::new()?;
let toml = r#"
model = "gpt-5.4"
[features.apps_mcp_path_override]
enabled = true
path = "/custom/mcp"
"#;
let cfg: ConfigToml =
toml::from_str(toml).expect("TOML deserialization should succeed for apps MCP feature");
let config = Config::load_from_base_config_with_overrides(
cfg,
ConfigOverrides::default(),
codex_home.abs(),
)
.await?;
assert_eq!(
config.apps_mcp_path_override.as_deref(),
Some("/custom/mcp")
);
assert!(config.features.enabled(Feature::AppsMcpPathOverride));
Ok(())
}
#[tokio::test]
async fn config_loads_mcp_oauth_callback_url_from_toml() -> std::io::Result<()> {
let codex_home = TempDir::new()?;

View File

@@ -2615,6 +2615,7 @@ impl Config {
.and_then(|config| config.path.as_ref())
.or_else(|| base.and_then(|config| config.path.as_ref()))
.cloned()
.or_else(|| Some("/ps/mcp".to_string()))
} else {
None
};