Let unrelated tools run while MCP servers start (#35937)

## Why

Cached MCP definitions can make a tool callable before its server has finished
starting. Waiting for that server while holding the tool execution gate blocks
unrelated calls in the same response.

## What changed

- Expose the owning MCP server through tool runtime metadata, including tools
  with exposure overrides.
- Refresh MCP state and wait for that specific server before entering the
  parallel execution gate.

## Testing

Extend the cached MCP tool regression test to verify that an unrelated plan
update completes while MCP startup remains pending.

GitOrigin-RevId: 884d154bc403dfc1d347d265da3d6a887948e7b6
This commit is contained in:
jif authored and copyberry committed 2026-07-29 11:14:16 +00:00
1 parent fe01054a28
commit fbf666fa98
7 files changed
+91 -6

No files matched your search

+4
View File
@@ -149,6 +149,10 @@ impl ToolRouter {
.unwrap_or(false)
}
pub(crate) fn mcp_server_name(&self, call: &ToolCall) -> Option<&str> {
self.registry.mcp_server_name(&call.tool_name)
}
pub fn tool_waits_for_runtime_cancellation(&self, call: &ToolCall) -> bool {
self.registry
.waits_for_runtime_cancellation(&call.tool_name)