Quarantine MCP config from Codex products

This commit is contained in:
Meta Vens 2026-05-13 12:43:32 +01:00
commit 0854433b70
9 changed files with 31 additions and 43 deletions

View file

@ -767,6 +767,13 @@ host-lifecycle calls that create, snapshot, and remove watches for loaded
threads. There is no longer a root `epiphany_invalidation.rs` module under
vendored app-server.
The MCP config path is now product-quarantined. `Config::to_mcp_config` keeps
user-declared MCP servers but no longer accepts a `PluginsManager`, folds
plugin-provided MCP servers into the runtime, enables Codex apps, enables skill
MCP dependency install, or advertises plugin capability summaries. MCP remains
a JSON-RPC protocol edge; Codex apps/skills/plugins no longer get smuggled
through that edge as if they were the protocol.
The Phase 6 freshness slice is landed. It exposes read-only
`thread/epiphany/freshness` from live retrieval summaries plus graph
frontier/churn state and, for loaded threads, watcher-backed invalidation

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -5888,9 +5888,7 @@ impl CodexMessageProcessor {
return;
}
};
let mcp_config = config
.to_mcp_config(self.thread_manager.plugins_manager().as_ref())
.await;
let mcp_config = config.to_mcp_config();
let auth = self.auth_manager.auth().await;
let environment_manager = self.thread_manager.environment_manager();
let runtime_environment = match environment_manager.default_environment() {
@ -6057,9 +6055,7 @@ impl CodexMessageProcessor {
return;
}
};
let mcp_config = config
.to_mcp_config(self.thread_manager.plugins_manager().as_ref())
.await;
let mcp_config = config.to_mcp_config();
let auth = self.auth_manager.auth().await;
let runtime_environment = {
let environment_manager = self.thread_manager.environment_manager();

View file

@ -5,7 +5,6 @@ use crate::config::edit::ConfigEditsBuilder;
use crate::config::edit::apply_blocking;
use crate::config_loader::RequirementSource;
use crate::config_loader::project_trust_key;
use crate::plugins::PluginsManager;
use assert_matches::assert_matches;
use codex_config::CONFIG_TOML_FILE;
use codex_config::config_toml::AgentRoleToml;
@ -2594,7 +2593,7 @@ approval_mode = "approve"
}
#[tokio::test]
async fn to_mcp_config_preserves_apps_feature_from_config() -> std::io::Result<()> {
async fn to_mcp_config_quarantines_codex_product_surfaces() -> std::io::Result<()> {
let codex_home = TempDir::new()?;
let mut config = Config::load_from_base_config_with_overrides(
ConfigToml::default(),
@ -2602,18 +2601,19 @@ async fn to_mcp_config_preserves_apps_feature_from_config() -> std::io::Result<(
codex_home.abs(),
)
.await?;
let plugins_manager = PluginsManager::new(codex_home.path().to_path_buf());
let mcp_config = config.to_mcp_config(&plugins_manager).await;
assert!(mcp_config.apps_enabled);
let mcp_config = config.to_mcp_config();
assert!(!mcp_config.apps_enabled);
assert!(!mcp_config.skill_mcp_dependency_install_enabled);
assert!(mcp_config.plugin_capability_summaries.is_empty());
let _ = config.features.disable(Feature::Apps);
let mcp_config = config.to_mcp_config(&plugins_manager).await;
let mcp_config = config.to_mcp_config();
assert!(!mcp_config.apps_enabled);
let _ = config.features.enable(Feature::Apps);
let mcp_config = config.to_mcp_config(&plugins_manager).await;
assert!(mcp_config.apps_enabled);
let mcp_config = config.to_mcp_config();
assert!(!mcp_config.apps_enabled);
Ok(())
}

View file

@ -806,31 +806,20 @@ impl Config {
}
}
pub async fn to_mcp_config(
&self,
plugins_manager: &crate::plugins::PluginsManager,
) -> McpConfig {
let loaded_plugins = plugins_manager.plugins_for_config(self).await;
let mut configured_mcp_servers = self.mcp_servers.get().clone();
for (name, plugin_server) in loaded_plugins.effective_mcp_servers() {
configured_mcp_servers.entry(name).or_insert(plugin_server);
}
pub fn to_mcp_config(&self) -> McpConfig {
McpConfig {
chatgpt_base_url: self.chatgpt_base_url.clone(),
codex_home: self.codex_home.to_path_buf(),
mcp_oauth_credentials_store_mode: self.mcp_oauth_credentials_store_mode,
mcp_oauth_callback_port: self.mcp_oauth_callback_port,
mcp_oauth_callback_url: self.mcp_oauth_callback_url.clone(),
skill_mcp_dependency_install_enabled: self
.features
.enabled(Feature::SkillMcpDependencyInstall),
skill_mcp_dependency_install_enabled: false,
approval_policy: self.permissions.approval_policy.clone(),
codex_linux_sandbox_exe: self.codex_linux_sandbox_exe.clone(),
use_legacy_landlock: self.features.use_legacy_landlock(),
apps_enabled: self.features.enabled(Feature::Apps),
configured_mcp_servers,
plugin_capability_summaries: loaded_plugins.capability_summaries().to_vec(),
apps_enabled: false,
configured_mcp_servers: self.mcp_servers.get().clone(),
plugin_capability_summaries: Vec::new(),
}
}

View file

@ -244,7 +244,7 @@ pub async fn list_accessible_connectors_from_mcp_tools_with_environment_manager(
});
}
let mcp_config = config.to_mcp_config(plugins_manager.as_ref()).await;
let mcp_config = config.to_mcp_config();
let mcp_servers = with_codex_apps_mcp(HashMap::new(), auth.as_ref(), &mcp_config);
if mcp_servers.is_empty() {
return Ok(AccessibleConnectorsStatus {

View file

@ -11,17 +11,15 @@ use codex_mcp::effective_mcp_servers;
use codex_mcp::tool_plugin_provenance as collect_tool_plugin_provenance;
#[derive(Clone)]
pub struct McpManager {
plugins_manager: Arc<PluginsManager>,
}
pub struct McpManager;
impl McpManager {
pub fn new(plugins_manager: Arc<PluginsManager>) -> Self {
Self { plugins_manager }
pub fn new(_plugins_manager: Arc<PluginsManager>) -> Self {
Self
}
pub async fn configured_servers(&self, config: &Config) -> HashMap<String, McpServerConfig> {
let mcp_config = config.to_mcp_config(self.plugins_manager.as_ref()).await;
let mcp_config = config.to_mcp_config();
configured_mcp_servers(&mcp_config)
}
@ -30,12 +28,12 @@ impl McpManager {
config: &Config,
auth: Option<&CodexAuth>,
) -> HashMap<String, McpServerConfig> {
let mcp_config = config.to_mcp_config(self.plugins_manager.as_ref()).await;
let mcp_config = config.to_mcp_config();
effective_mcp_servers(&mcp_config, auth)
}
pub async fn tool_plugin_provenance(&self, config: &Config) -> ToolPluginProvenance {
let mcp_config = config.to_mcp_config(self.plugins_manager.as_ref()).await;
let mcp_config = config.to_mcp_config();
collect_tool_plugin_provenance(&mcp_config)
}
}

View file

@ -210,9 +210,7 @@ impl Session {
) {
let auth = self.services.auth_manager.auth().await;
let config = self.get_config().await;
let mcp_config = config
.to_mcp_config(self.services.plugins_manager.as_ref())
.await;
let mcp_config = config.to_mcp_config();
let tool_plugin_provenance = self
.services
.mcp_manager