Expand description
Agent core: ReAct loop, main agent, prompts, sub-agents, compaction.
Modules§
- compact
- Context compaction — round-aware compact view.
- main_
agent - MainAgent — assembles the system prompt, builds the tool registry, and drives the ReAct loop for a task.
- prompts
- System prompts, ported from Python
core/prompts.py. Kept in sync 2026-07 with the richer tool descriptions and anti-hallucination guard words from the Python aacode version. - react_
loop - The ReAct loop — iterate model calls + tool execution until completion.
- sanitize
- Message-history sanitizer: guarantees the OpenAI tool-calling invariant
“an assistant message with
tool_callsmust be followed by tool messages responding to eachtool_call_id” before anything is sent to the API. - sub_
agent - SubAgent — a focused agent (code/test/research) that runs its own ReAct loop with a specialized system prompt and a shared tool registry.
Structs§
- Main
Agent - React
Loop - The ReAct loop driver. Borrows the collaborators for the duration of a run.
- RunResult
Enums§
- RunStatus
- Outcome of a run.