Restamp cached Codex Apps tool provenance

This commit is contained in:
Matthew Zeng
2026-05-03 22:22:36 -07:00
parent a67d0dc430
commit 24c953304d
2 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -12,6 +12,7 @@ use std::time::Instant;
use crate::runtime::emit_duration;
use crate::tools::MCP_TOOLS_CACHE_WRITE_DURATION_METRIC;
use crate::tools::ToolInfo;
use codex_config::McpServerProvenance;
use codex_login::CodexAuth;
use codex_utils_plugins::mcp_connector::is_connector_id_allowed;
use codex_utils_plugins::mcp_connector::sanitize_name;
@@ -206,7 +207,11 @@ pub(crate) fn load_cached_codex_apps_tools(
if cache.schema_version != CODEX_APPS_TOOLS_CACHE_SCHEMA_VERSION {
return CachedCodexAppsToolsLoad::Invalid;
}
CachedCodexAppsToolsLoad::Hit(filter_disallowed_codex_apps_tools(cache.tools))
let mut tools = filter_disallowed_codex_apps_tools(cache.tools);
for tool in &mut tools {
tool.server_provenance = McpServerProvenance::HostOwnedCodexApps;
}
CachedCodexAppsToolsLoad::Hit(tools)
}
pub(crate) fn write_cached_codex_apps_tools(
@@ -641,6 +641,10 @@ fn startup_cached_codex_apps_tools_loads_from_disk_cache() {
assert_eq!(startup_tools.len(), 1);
assert_eq!(startup_tools[0].server_name, CODEX_APPS_MCP_SERVER_NAME);
assert_eq!(
startup_tools[0].server_provenance,
McpServerProvenance::HostOwnedCodexApps
);
assert_eq!(startup_tools[0].callable_name, "calendar_search");
}