#[non_exhaustive]pub struct AgentLoopConfig { /* private fields */ }Expand description
Configuration for the agent loop.
§One-config-per-run invariant (#44)
These values are SNAPSHOTTED once, from the live Config under a brief read
lock, at the start of AgentRuntime::execute(). The entire multi-round run —
which can last minutes — then uses this frozen snapshot. Changing config
(model names, provider, disabled_tools/disabled_skills, memory flags,
token budget, …) while a run is in flight does NOT affect that run; the new
values are picked up on the NEXT execution (i.e. the next user turn / session
restart), not the next round of the current run.
This is intentional: a run sees a stable configuration, so its behavior can’t
shift underneath it mid-execution. The deliberate exceptions are the
late-bound, per-request trait objects that resolve LIVE each time they’re
used rather than being snapshotted — auxiliary_model_resolver (auxiliary
model selection) and guardian_spawner (the reviewer child). If a frozen
field ever needs to become live-per-round, follow that resolver pattern
rather than widening the snapshot.
Implementations§
Source§impl AgentLoopConfig
impl AgentLoopConfig
Sourcepub fn active_goal(&self) -> Option<&str>
pub fn active_goal(&self) -> Option<&str>
The active session goal to surface to the main agent, or None when
Gold is disabled or no goal is set. Falls back to the legacy
evaluation_prompt for back-compat via GoldConfig::effective_goal.
Sourcepub fn goal_loop_active(&self) -> bool
pub fn goal_loop_active(&self) -> bool
Whether the Codex-style autonomous goal loop is active for this run.
This requires Gold to be enabled, a goal to be set, AND auto-continue to
be on. Only then is the update_goal self-report tool surfaced to the
model and the terminal double-check allowed to veto a premature stop.
When Gold is enabled without auto-continue, the evaluator stays purely
observational (legacy behavior).
Sourcepub fn guardian_active(&self) -> bool
pub fn guardian_active(&self) -> bool
Whether the guardian review gate is active for this run: a spawner is wired (so the runner can actually create the reviewer child) AND the config is present and enabled.
Sourcepub fn guardian_max_reviews(&self) -> u32
pub fn guardian_max_reviews(&self) -> u32
Maximum guardian review passes for this run (the budget). 0 when no
guardian config is set.
Sourcepub fn guardian_model(&self) -> Option<&str>
pub fn guardian_model(&self) -> Option<&str>
The reviewer model override, if a guardian config sets one.
Sourcepub fn delegation_active(&self) -> bool
pub fn delegation_active(&self) -> bool
Whether child→parent approval delegation is wired for this run.