Expand description
Tool batch execution.
Canonical prepare / execute / finalize chain for model-emitted tool calls.
Two modes:
- Parallel (default): all tools in the batch prep sequentially, then run concurrently, then finalize sequentially in source order.
- Sequential: each tool is prepped, executed, and finalized
before the next starts. Triggered by either:
- any tool in the batch setting
requires_exclusive_sandbox = true, or LoopConfig.default_execution_mode = Sequential(loop-wide pin).
- any tool in the batch setting
Hook plumbing:
BeforeToolCall::on_before_tool_callruns after argument validation, beforetool.execute. Mayblockto short-circuit with an error tool result.AfterToolCall::on_after_tool_callruns aftertool.execute. Mayoverride_result,mark_error, or voteterminate.