pub struct RunLimits {
pub max_steps: u32,
pub timeout_ms: u64,
pub max_step_retries: u32,
pub terminal_app: Option<String>,
pub workflow_id_for_memory: Option<String>,
pub memory_db_path: Option<String>,
}Expand description
Budget limits for a single agent run.
These are the only knobs the agent loop itself consumes. Callers
that used to set enable_vision / enable_decomposition / self_heal
/ enable_notebook are expected to stop — those behaviors are now
implicit in the canonical agent loop.
Fields§
§max_steps: u32Total step budget across all sub-goals. A step that retries 3 times still counts as 1 step.
timeout_ms: u64Wall-clock deadline in milliseconds. Measured from
GoalRunner::run start, not per sub-goal.
max_step_retries: u32Per-step retry cap. Default: 3. See the 3-strike rule in
docs/canonical-agent-plan.md.
terminal_app: Option<String>App name the goal should ultimately land its output in (e.g.
"Numbers" for a spreadsheet scenario). When set, the runner
enforces a phase-gate: once steps_used >= max_steps / 2 with
no terminal-app work recorded (no write_cells/save_document
action, and frontmost app != terminal_app), it injects a
synthetic history record telling the planner its next batch
MUST begin with activate_app(terminal_app). On a second
ignore the runner auto-dispatches the activation itself.
None = no phase-gate enforcement (legacy behaviour).
workflow_id_for_memory: Option<String>PR2 opt-in: when set together with memory_db_path, the canonical
runner writes a final outcome memory under this workflow_id
after the run terminates (success or failure). Defaults to None
— no memory writes happen if the caller doesn’t ask for them.
Mirrors the cel_perceive start { enable_memory, workflow_id }
opt-in for sessions; here it’s at the runner level so any caller
of CanonicalGoalRunner::run (CLI, MCP, eval harness, worker) can opt
in independently.
memory_db_path: Option<String>PR2 opt-in: SQLite path the canonical runner uses to write the
final outcome memory. Required alongside workflow_id_for_memory
for the auto-write to fire.