Skip to main content Module loop Copy item path Source LoopConfig Configuration for the agent loop. TurnUpdate Optional return value from prepare_next_turn to modify context for the next turn. AgentEvent Emitted by the loop for consumers (print mode writes to stdout; TUI later renders). collect_tool_defs Collect tool definitions from all extensions. run_agent_loop Run the full agent loop. Returns all new messages added during the run.
history contains pre-existing messages from a previous session (if continuing). PrepareNextTurnFn Prepare-next-turn function: optionally modifies context between turns. ShouldStopFn Should-stop-after-turn predicate: early-stop check. TransformFn Transform function: rewrites messages before each LLM call.