Skip to main content

Module loop_driver

Module loop_driver 

Source
Expand description

Core agent loop driver

AgentRunner is the “missing middle” — the robust loop that sits between the apps (CLI, API) and the enact-core kernel. It implements:

  • Multi-iteration tool call loop (ported from zeroclaw’s run_tool_call_loop)
  • Multi-format tool call parsing (JSON, XML, Markdown)
  • Auto context compaction when history grows too large
  • Retry with exponential backoff for transient errors
  • Checkpoint saving at configured intervals
  • Stream event emission throughout
  • LLM call tracing and token/cost accounting (observability)

This fulfills the mandate from 28-TS-RUST-INTEGRATION.md: “Rust handles retries/fallbacks” and 27-LONG-RUNNING-EXECUTIONS.md: “Unified long-running agentic loop”.

Structs§

AgentRunner
The robust agent runner — drives the tool call loop with retries, compaction, and multi-format parsing.

Enums§

LoopOutcome
Outcome of a runner loop execution.

Type Aliases§

DefaultAgentRunner
Convenience: create an AgentRunner with default in-memory checkpoint store.