org.llm4s.agent.graph.toolloop.ToolLoop
See theToolLoop companion object
The model/tool loop as a graph - the Stage 0 proof of runtime-owned tool results and resumable approval ((#1269)):
input -> model --fan-out, one task per call--> call-tool --(dynamic join "tool-batch")--> collect -> model
\--suspend--> approval --/
- Each call is its own task: policy first, then the tool. A policy
RequireApprovaland a tool'sNeedsApprovalboth suspend the call with an ApprovalRequest and resume at the oneapprovalnode, whose continuation fills that call's slot in the batch barrier. - The loop, not the tool, records exactly one ToolResult per call - for success, failure, denial, rejection and unknown tools alike; the results key refuses a second one.
collectruns only when the barrier releases, checks every call of the batch has exactly one result, and appends theToolMessages in call order. The model never sees a partial batch.- The model node re-checks the history with
Message.validateConversationbefore every call.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article