Skip to main content

Module state

Module state 

Source
Expand description

Agent state management.

This module manages the runtime state of the Agent, including:

  • Message history
  • Token usage tracking
  • Pending inputs
  • Todo reminders
  • Read history
  • Tool error history (for repeat error detection)

By extracting state into a dedicated struct, we enable:

  • Clear separation between state and configuration
  • Easier testing of state transitions
  • Better encapsulation of mutable state

Structs§

AgentState
Agent runtime state.
ToolErrorEntry
A tool error entry for tracking repeated errors.

Constants§

MAX_SAME_ERROR_COUNT
Maximum number of same errors before triggering intervention