Autobot::Agent::Loop
The agent loop is the core processing engine
It:
- Receives messages from the bus
- Builds context with history, memory, skills
- Calls the LLM via ToolExecutor
- Sends responses back
Constants
BACKGROUND_EXCLUDED_TOOLS = ["spawn"]
Tools excluded from background turns (cron jobs, subagent work).
FALLBACK_RESPONSE = "I've completed processing but have no response to give."
GENERIC_ERROR_MESSAGE = "Sorry, I encountered an unexpected error. Please try again."
HEARTBEAT_INTERVAL = 1.second
Log = ::Log.for("agent.loop")
LONG_MESSAGE_PREVIEW_LENGTH = 120
SHORT_MESSAGE_PREVIEW_LENGTH = 80
VOICE_NOTE_NOT_HEARD = "I could not hear that voice note. Voice transcription is not available here, so please type it instead."
Constructors
new(bus : Bus::MessageBus, provider : Providers::Provider, workspace : Path, tools : Tools::Registry, sessions : Session::Manager, model : String | Nil = nil, max_iterations : Int32 = 20, memory_window : Int32 = 50, cron_service : Cron::Service | Nil = nil, brave_api_key : String | Nil = nil, exec_timeout : Int32 = 60, exec_deny_patterns : Array(Regex) = Tools::ExecTool::DEFAULT_DENY_PATTERNS, exec_allow_patterns : Array(Regex) = [] of Regex, sandbox_config : String = "auto", rate_limiter : Tools::RateLimiter | Nil = nil, enabled_tools : Array(String) = [] of String, filesystem_roots : Array(String) = [] of String, web_allowed_domains : Array(String) = [] of String)
Source