Configurable ReAct loop controller.
Drives a generate → act → observe cycle, delegating LLM inference and tool execution to the caller-provided LoopContext. The loop terminates when:
maxIterations
failureMode
'fail_closed'
All intermediate events are yielded so callers can stream output to the user or record an audit trace.
Execute the ReAct loop and yield LoopEvents.
Loop behaviour configuration.
Callbacks to the underlying LLM/tool layer.
Structured events for each phase of the loop.
Only when failureMode === 'fail_closed' and a tool fails.
failureMode === 'fail_closed'
Configurable ReAct loop controller.
Drives a generate → act → observe cycle, delegating LLM inference and tool execution to the caller-provided LoopContext. The loop terminates when:
maxIterationsis exceeded, orfailureModeis'fail_closed'.All intermediate events are yielded so callers can stream output to the user or record an audit trace.