claude/agent/tool_runner
Types
Result type for a single tool execution: (tool_use_id, result_or_error).
pub type ToolResult =
#(String, Result(String, String))
Values
pub fn execute_concurrent(
tool_calls tool_calls: List(content.ContentBlock),
tools tools: tool.Registry,
timeout_ms timeout: Int,
) -> List(#(String, Result(String, String)))
Execute tool calls concurrently using BEAM processes.
Spawns one unlinked, monitored process per tool call, then collects results with a timeout. Results are returned in the same order as the input tool_calls. Non-ToolUse blocks in the input list are silently ignored.
If a tool handler exceeds the timeout, an Error(“Tool execution timed out”) is returned for that tool. If a tool handler crashes, the monitor detects the exit and an Error describing the crash reason is returned immediately rather than waiting for the full timeout.