wrap_tool_call(
self,
request: ToolCallRequest,
handler: Callable[[ToolCallRequest], ToolMessage | Command| Name | Type | Description |
|---|---|---|
request* | ToolCallRequest | |
handler* | Callable[[ToolCallRequest], ToolMessage | Command[Any]] |
Log a rejected ask_user call, then pass the result through.
ToolNode converts an argument ValidationError into an error
ToolMessage before it reaches here, and it logs nothing itself, so
without this a model sending malformed arguments — or looping on them —
leaves no operator-visible record at all. The user sees only a red
ask_user row in the transcript.
The result type is the discriminant: _ask_user always returns a
Command, so a ToolMessage here means the call never entered the tool
body. That keeps this off the _parse_answers error path, which reports
a malformed resume payload inside a Command and logs itself.
Nothing is caught. An exception from the body must stay fatal, and
GraphBubbleUp from interrupt() must keep bubbling.
The tool call request.
Callable that executes the tool.