mirror of
https://github.com/openai/codex.git
synced 2026-11-05 16:29:31 +00:00
[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:
1 parent
c9edb26755
commit
a98b57d065
2 files changed
+53
No files matched your search
@@ -8769,6 +8769,58 @@ path = "/custom/mcp"
|
|||||||
Ok(())
|
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]
|
#[tokio::test]
|
||||||
async fn config_loads_mcp_oauth_callback_url_from_toml() -> std::io::Result<()> {
|
async fn config_loads_mcp_oauth_callback_url_from_toml() -> std::io::Result<()> {
|
||||||
let codex_home = TempDir::new()?;
|
let codex_home = TempDir::new()?;
|
||||||
|
|||||||
@@ -2615,6 +2615,7 @@ impl Config {
|
|||||||
.and_then(|config| config.path.as_ref())
|
.and_then(|config| config.path.as_ref())
|
||||||
.or_else(|| base.and_then(|config| config.path.as_ref()))
|
.or_else(|| base.and_then(|config| config.path.as_ref()))
|
||||||
.cloned()
|
.cloned()
|
||||||
|
.or_else(|| Some("/ps/mcp".to_string()))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user