Skip to main content

Module agent_loop

Module agent_loop 

Source
Expand description

Core agent loop: LLM ↔ tool execution cycle.

Phase 1: simple loop (no task planning). Phase 2: task-planning-aware loop + run_command + LLM summarization.

Ported from Python AgenticLoop._run_openai. Single implementation that works for both CLI and RPC via the EventSink trait.

Sub-modules:

  • planning — pre-loop setup, LLM task-list generation, checkpoint saving
  • execution — tool-call batch processing, progressive disclosure, depth limits
  • reflection — no-tool response handling, hallucination guard, auto-nudge
  • helpers — shared low-level utilities (tool execution, result processing, …)

Functions§

run_agent_loop
Run the agent loop.