mirror of
https://github.com/openai/codex.git
synced 2026-12-05 01:00:54 +00:00
Preserve MCP namespace descriptions in the tool catalog cache (#38623)
## What changed Keep MCP namespace descriptions when publishing tool definitions to the process-scoped catalog cache. Cached definitions now expose the server instructions to the model before a lazily started MCP connection finishes initializing. ## Testing Update the cached MCP startup integration test to verify that cached namespace descriptions retain the originating server instructions. GitOrigin-RevId: d1b73381852fd43c6b54a7c22a599474c774dc20
This commit is contained in:
@@ -161,8 +161,6 @@ impl McpToolCatalogCacheContext {
|
||||
|
||||
let mut tools = tools.to_vec();
|
||||
for tool in &mut tools {
|
||||
// Initialize instructions belong to one live connection and must not cross sessions.
|
||||
tool.namespace_description = None;
|
||||
// Tool annotations affect approval and parallelism decisions, so only the live
|
||||
// connection may supply them.
|
||||
tool.tool.annotations = None;
|
||||
|
||||
@@ -534,7 +534,7 @@ async fn cached_mcp_startup_is_eager_for_root_and_lazy_for_subagents() -> anyhow
|
||||
);
|
||||
assert_definition(
|
||||
&unused_response,
|
||||
&format!("Tools in the {NAMESPACE} namespace."),
|
||||
&format!("Use the tools from {cached_process}."),
|
||||
&format!("Echo from {cached_process}."),
|
||||
);
|
||||
assert_eq!(
|
||||
@@ -631,7 +631,7 @@ async fn cached_mcp_startup_is_eager_for_root_and_lazy_for_subagents() -> anyhow
|
||||
.context("cached MCP definitions should reach inference before initialization")?;
|
||||
assert_definition(
|
||||
&cached_response,
|
||||
&format!("Tools in the {NAMESPACE} namespace."),
|
||||
&format!("Use the tools from {cached_process}."),
|
||||
&format!("Echo from {cached_process}."),
|
||||
);
|
||||
let second_pid = wait_for_new_pid(fs.as_ref(), &pid_file, Some(&eager_pid)).await?;
|
||||
|
||||
Reference in New Issue
Block a user