Skip to main content

Module agent

Module agent 

Source
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_calls must be followed by tool messages responding to each tool_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§

MainAgent
ReactLoop
The ReAct loop driver. Borrows the collaborators for the duration of a run.
RunResult

Enums§

RunStatus
Outcome of a run.