mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Reuse executor Discovery V2 inventories across turns (#62640)
## Why Starting a turn discarded the discovery cache and forced MCP to rebuild from a fresh inventory even when the executor context was unchanged. An MCP refresh could also discover a different inventory from the one the step had already captured. ## What changed Keep a per-thread cache keyed by environment, executor session, working directory, and sandbox. Explicit invalidation reloads discovery on the next lookup and lets in-flight readers finish with their captured results. Use the step's captured inventory for MCP reconciliation and bind it with the current MCP policy. Apply the binding's plugin policy when selecting skills and hooks. ## Testing Cover cache reuse across turns, lazy invalidation during in-flight discovery, and MCP refresh with a captured inventory after a server has been revoked. GitOrigin-RevId: 8d4087dffdb3d6feef2456918a08ae7724cf18e4
This commit is contained in:
committed by
copyberry
parent
9224da4ce1
commit
e720e6c80b
@@ -32,6 +32,7 @@ use codex_config::types::OAuthCredentialsStoreMode;
|
||||
use codex_connectors::ConnectorRuntimeManager;
|
||||
use codex_connectors::ConnectorSnapshot;
|
||||
use codex_connectors::connector_runtime_context_key;
|
||||
use codex_exec_server::ExecutorCapabilityDiscoveryV2Snapshot;
|
||||
use codex_exec_server::FileSystemSandboxContext;
|
||||
use codex_login::CodexAuth;
|
||||
use codex_model_provider::CHATGPT_CODEX_BASE_URL;
|
||||
@@ -226,6 +227,8 @@ pub struct McpConfig {
|
||||
/// Plugin declarations used to attribute connector tools to plugin display names.
|
||||
/// MCP registrations retain their own package attribution in the catalog.
|
||||
pub connector_snapshot: ConnectorSnapshot,
|
||||
/// Executor inventory used to project this runtime, retained with its binding.
|
||||
pub executor_discovery_v2: Option<Arc<[ExecutorCapabilityDiscoveryV2Snapshot]>>,
|
||||
}
|
||||
|
||||
/// Default amount of time a tool catalog capture waits for optional MCP servers.
|
||||
|
||||
@@ -254,6 +254,7 @@ pub(crate) fn test_mcp_config(codex_home: PathBuf) -> McpConfig {
|
||||
host_owned_apps_protocol_mode: McpProtocolMode::Legacy,
|
||||
mcp_server_catalog: ResolvedMcpCatalog::default(),
|
||||
connector_snapshot: codex_connectors::ConnectorSnapshot::default(),
|
||||
executor_discovery_v2: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user