mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Start cached MCP servers lazily for subagents (#37261)
## Why Subagents can reuse cached MCP tool definitions without starting every optional server before any of its tools are used. ## What changed - Defer startup for subagent-owned, optional MCP servers when their cache has at least one visible, allowed tool, and trigger startup on the first operation that needs the live client. - Keep root sessions, required servers, selected plugin servers, and explicit reconnects eager. - Exclude empty catalogs from cache eligibility and keep dormant servers out of the initial startup summary. ## Testing - Extend MCP tool-cache coverage for eager root startup, unused and filtered subagent servers, deferred startup status events, and startup that survives an interrupted first tool call. GitOrigin-RevId: e7528ff08312583a6747cbc6550ea5b6eabda9a6
This commit is contained in:
1 parent
a17da5e6e4
commit
1151b23f01
13 files changed
+325
-31
No files matched your search
@@ -316,10 +316,10 @@ impl ManagedClientStartup {
|
||||
.startup_timeout_sec
|
||||
.unwrap_or(DEFAULT_STARTUP_TIMEOUT);
|
||||
let cancel_token_for_fut = cancel_token;
|
||||
let tool_catalog_fetch_ticket = tool_catalog_cache_context
|
||||
.as_ref()
|
||||
.map(McpToolCatalogCacheContext::begin_fetch);
|
||||
async move {
|
||||
let tool_catalog_fetch_ticket = tool_catalog_cache_context
|
||||
.as_ref()
|
||||
.map(McpToolCatalogCacheContext::begin_fetch);
|
||||
let refresh_start = is_codex_apps_mcp_server.then(Instant::now);
|
||||
let outcome = match async {
|
||||
if let Err(error) = validate_mcp_server_name(&server_name) {
|
||||
|
||||
Reference in new issue
Block a user