266
def _should_parallelize_tool_batch(tool_calls) -> bool:
267
"""Return True when a tool-call batch is safe to run concurrently."""
268
if len(tool_calls) <= 1:
269
return False
270
tool_names = [tc.function.name for tc in tool_calls]
271
if any(name in _NEVER_PARALLEL_TOOLS for name in tool_names):
272
return False
273
reserved_paths: list[Path] = []
274
for tool_call in tool_calls:
275
if any(_paths_overlap(p, existing) for existing in reserved_paths):
276
return False
277
return True