AgentRunner owns the loop and the TaskState. Everything else is
a stateless worker or a passive store.
The per-turn cycle
ContextBuilderassembles a compact packet fromTaskState— goal, phase, recent evidence, and the tools allowed for the current phase. The model discovers the repo incrementally through tools, never receiving the whole repo.ModelClientreturns exactly one validatedModelDecision(tool_call,final_answer, orask_user). Malformed output is fed back as a recoverable error, never executed.ToolRuntimevalidates and dispatches tool calls. Tools reach the filesystem only through theWorkspace, which confines paths to the repo root and pins a diff baseline.- The
AgentRunnerapplies the result toTaskStateand emits observation events. Afinal_answertriggers theVerifier.
Verification, not self-certification
TheVerifier runs no model. Every check is a predicate over structured
TaskState plus the workspace diff, selected by task_kind (edit /
investigate / test_only) so the right contract applies. It passes only on
required checks with positive external signal — never vacuously on skipped
checks.
This page is a synthesized overview. For the full design rationale, each
component’s docstring (see the API reference) cites the relevant design
section.