Summary
build_tool_map in the mcp_tool_resolve filter currently resolves MCP servers sequentially. With max_servers: 10 and timeout_ms: 5000, a request referencing 10 slow servers blocks for up to 50 seconds of serial I/O since each server resolution waits for the previous one to complete.
Proposal
Use tokio::JoinSet (or futures::future::join_all) to resolve servers concurrently, bounded by max_servers. Each server resolution is independent so there is no ordering constraint.
The concurrency cap already exists via max_servers in the filter config, which can serve as the natural bound on parallelism.
Files
apis/src/openai/responses/mcp_tool_resolve/mod.rs — build_tool_map function (~line 133)
Context
Raised during review of PR #331. Deferred to a follow-up since it's an optimization, not a correctness fix.
Summary
build_tool_mapin themcp_tool_resolvefilter currently resolves MCP servers sequentially. Withmax_servers: 10andtimeout_ms: 5000, a request referencing 10 slow servers blocks for up to 50 seconds of serial I/O since each server resolution waits for the previous one to complete.Proposal
Use
tokio::JoinSet(orfutures::future::join_all) to resolve servers concurrently, bounded bymax_servers. Each server resolution is independent so there is no ordering constraint.The concurrency cap already exists via
max_serversin the filter config, which can serve as the natural bound on parallelism.Files
apis/src/openai/responses/mcp_tool_resolve/mod.rs—build_tool_mapfunction (~line 133)Context
Raised during review of PR #331. Deferred to a follow-up since it's an optimization, not a correctness fix.