Skip attribution for direct MCP tool calls (#58938)

## Why

`CodexThread::call_mcp_tool` returns only the tool result, so computing attribution and creating a cached runtime binding for these calls is unnecessary.

## What changed

Add `McpRuntime::latest_call_tool_without_attribution` and use it for direct thread calls. Validate the call, wait for server startup, and dispatch through the latest connections without capturing an attribution binding.

## Testing

Extend the runtime binding cache test to verify that a successful call without attribution leaves the cached binding empty. Update the test server to return a successful tool result.

GitOrigin-RevId: 898e655d9a0174ddaf71c390757d6fc9a5a61780
This commit is contained in:
victor-openai
2026-11-02 17:55:39 +00:00
committed by copyberry
parent 172d8fc593
commit 62bf900680
3 changed files with 38 additions and 5 deletions
+1 -5
View File
@@ -1369,12 +1369,8 @@ impl CodexThread {
self.session
.services
.mcp_runtime
.latest_call_tool(
server, tool, /*environment_id*/ None, arguments, meta,
/*requested_timeout*/ None, /*wait_for_server*/ true,
)
.latest_call_tool_without_attribution(server, tool, arguments, meta)
.await
.map(|call| call.result)
}
pub fn enabled(&self, feature: Feature) -> bool {