Skip to main content

Module exec

Module exec 

Source
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).

Hook plumbing:

  • BeforeToolCall::on_before_tool_call runs after argument validation, before tool.execute. May block to short-circuit with an error tool result.
  • AfterToolCall::on_after_tool_call runs after tool.execute. May override_result, mark_error, or vote terminate.