test: update MCP parallel-batch fixture names to mcp__server__tool convention
TestMcpParallelToolBatch seeded provenance under old-style mcp_<server>_<tool> names, which no longer pass the is_mcp_tool_parallel_safe() prefix gate after the naming change.fix/verification-admin-route-recovery
parent
e01f58ff1f
commit
3d0276182a
|
|
@ -3586,8 +3586,8 @@ class TestMcpParallelToolBatch:
|
||||||
def test_mcp_tools_default_sequential(self):
|
def test_mcp_tools_default_sequential(self):
|
||||||
"""MCP tools without supports_parallel_tool_calls are sequential."""
|
"""MCP tools without supports_parallel_tool_calls are sequential."""
|
||||||
from run_agent import _should_parallelize_tool_batch
|
from run_agent import _should_parallelize_tool_batch
|
||||||
tc1 = _mock_tool_call(name="mcp_github_list_repos", arguments='{"org":"openai"}', call_id="c1")
|
tc1 = _mock_tool_call(name="mcp__github__list_repos", arguments='{"org":"openai"}', call_id="c1")
|
||||||
tc2 = _mock_tool_call(name="mcp_github_search_code", arguments='{"q":"test"}', call_id="c2")
|
tc2 = _mock_tool_call(name="mcp__github__search_code", arguments='{"q":"test"}', call_id="c2")
|
||||||
assert not _should_parallelize_tool_batch([tc1, tc2])
|
assert not _should_parallelize_tool_batch([tc1, tc2])
|
||||||
|
|
||||||
def test_mcp_tools_parallel_when_server_opted_in(self):
|
def test_mcp_tools_parallel_when_server_opted_in(self):
|
||||||
|
|
@ -3596,17 +3596,17 @@ class TestMcpParallelToolBatch:
|
||||||
from tools.mcp_tool import _mcp_tool_server_names, _parallel_safe_servers, _lock
|
from tools.mcp_tool import _mcp_tool_server_names, _parallel_safe_servers, _lock
|
||||||
with _lock:
|
with _lock:
|
||||||
_parallel_safe_servers.add("github")
|
_parallel_safe_servers.add("github")
|
||||||
_mcp_tool_server_names["mcp_github_list_repos"] = "github"
|
_mcp_tool_server_names["mcp__github__list_repos"] = "github"
|
||||||
_mcp_tool_server_names["mcp_github_search_code"] = "github"
|
_mcp_tool_server_names["mcp__github__search_code"] = "github"
|
||||||
try:
|
try:
|
||||||
tc1 = _mock_tool_call(name="mcp_github_list_repos", arguments='{"org":"openai"}', call_id="c1")
|
tc1 = _mock_tool_call(name="mcp__github__list_repos", arguments='{"org":"openai"}', call_id="c1")
|
||||||
tc2 = _mock_tool_call(name="mcp_github_search_code", arguments='{"q":"test"}', call_id="c2")
|
tc2 = _mock_tool_call(name="mcp__github__search_code", arguments='{"q":"test"}', call_id="c2")
|
||||||
assert _should_parallelize_tool_batch([tc1, tc2])
|
assert _should_parallelize_tool_batch([tc1, tc2])
|
||||||
finally:
|
finally:
|
||||||
with _lock:
|
with _lock:
|
||||||
_parallel_safe_servers.discard("github")
|
_parallel_safe_servers.discard("github")
|
||||||
_mcp_tool_server_names.pop("mcp_github_list_repos", None)
|
_mcp_tool_server_names.pop("mcp__github__list_repos", None)
|
||||||
_mcp_tool_server_names.pop("mcp_github_search_code", None)
|
_mcp_tool_server_names.pop("mcp__github__search_code", None)
|
||||||
|
|
||||||
def test_mixed_mcp_and_builtin_parallel(self):
|
def test_mixed_mcp_and_builtin_parallel(self):
|
||||||
"""MCP parallel tools mixed with built-in parallel-safe tools."""
|
"""MCP parallel tools mixed with built-in parallel-safe tools."""
|
||||||
|
|
@ -3614,15 +3614,15 @@ class TestMcpParallelToolBatch:
|
||||||
from tools.mcp_tool import _mcp_tool_server_names, _parallel_safe_servers, _lock
|
from tools.mcp_tool import _mcp_tool_server_names, _parallel_safe_servers, _lock
|
||||||
with _lock:
|
with _lock:
|
||||||
_parallel_safe_servers.add("docs")
|
_parallel_safe_servers.add("docs")
|
||||||
_mcp_tool_server_names["mcp_docs_search"] = "docs"
|
_mcp_tool_server_names["mcp__docs__search"] = "docs"
|
||||||
try:
|
try:
|
||||||
tc1 = _mock_tool_call(name="mcp_docs_search", arguments='{"query":"api"}', call_id="c1")
|
tc1 = _mock_tool_call(name="mcp__docs__search", arguments='{"query":"api"}', call_id="c1")
|
||||||
tc2 = _mock_tool_call(name="web_search", arguments='{"query":"test"}', call_id="c2")
|
tc2 = _mock_tool_call(name="web_search", arguments='{"query":"test"}', call_id="c2")
|
||||||
assert _should_parallelize_tool_batch([tc1, tc2])
|
assert _should_parallelize_tool_batch([tc1, tc2])
|
||||||
finally:
|
finally:
|
||||||
with _lock:
|
with _lock:
|
||||||
_parallel_safe_servers.discard("docs")
|
_parallel_safe_servers.discard("docs")
|
||||||
_mcp_tool_server_names.pop("mcp_docs_search", None)
|
_mcp_tool_server_names.pop("mcp__docs__search", None)
|
||||||
|
|
||||||
def test_mixed_parallel_and_serial_mcp_servers(self):
|
def test_mixed_parallel_and_serial_mcp_servers(self):
|
||||||
"""One parallel MCP server + one non-parallel MCP server = sequential."""
|
"""One parallel MCP server + one non-parallel MCP server = sequential."""
|
||||||
|
|
@ -3631,17 +3631,17 @@ class TestMcpParallelToolBatch:
|
||||||
with _lock:
|
with _lock:
|
||||||
_parallel_safe_servers.add("docs")
|
_parallel_safe_servers.add("docs")
|
||||||
# "github" is NOT in _parallel_safe_servers
|
# "github" is NOT in _parallel_safe_servers
|
||||||
_mcp_tool_server_names["mcp_docs_search"] = "docs"
|
_mcp_tool_server_names["mcp__docs__search"] = "docs"
|
||||||
_mcp_tool_server_names["mcp_github_list_repos"] = "github"
|
_mcp_tool_server_names["mcp__github__list_repos"] = "github"
|
||||||
try:
|
try:
|
||||||
tc1 = _mock_tool_call(name="mcp_docs_search", arguments='{"query":"api"}', call_id="c1")
|
tc1 = _mock_tool_call(name="mcp__docs__search", arguments='{"query":"api"}', call_id="c1")
|
||||||
tc2 = _mock_tool_call(name="mcp_github_list_repos", arguments='{"org":"openai"}', call_id="c2")
|
tc2 = _mock_tool_call(name="mcp__github__list_repos", arguments='{"org":"openai"}', call_id="c2")
|
||||||
assert not _should_parallelize_tool_batch([tc1, tc2])
|
assert not _should_parallelize_tool_batch([tc1, tc2])
|
||||||
finally:
|
finally:
|
||||||
with _lock:
|
with _lock:
|
||||||
_parallel_safe_servers.discard("docs")
|
_parallel_safe_servers.discard("docs")
|
||||||
_mcp_tool_server_names.pop("mcp_docs_search", None)
|
_mcp_tool_server_names.pop("mcp__docs__search", None)
|
||||||
_mcp_tool_server_names.pop("mcp_github_list_repos", None)
|
_mcp_tool_server_names.pop("mcp__github__list_repos", None)
|
||||||
|
|
||||||
|
|
||||||
class TestHandleMaxIterations:
|
class TestHandleMaxIterations:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue