StopReason¶
Goal¶
Stop reasons are a stable contract for debugging and evaluation.
What it is¶
StopReason is a standardized enum (stored as a string in StateSchema.stop_reason).
It is how QitOS makes runs comparable across:
- different prompts/parsers/tools
- different Env backends
- different recovery policies
Common stop reasons (with intent)¶
success: run completed successfully (may be used by tasks/env wrappers)final: agent produced a final answermax_steps/budget_steps: hit step budgetbudget_time: hit runtime budgetbudget_tokens: hit token budget (model-side)agent_condition:AgentModule.should_stop(...)requested stopcritic_stop: critic requested stop (if critic enabled)stagnation: stagnation detector stopped the run (if enabled)env_terminal: env indicated termination (e.g. container exited)task_validation_failed: Task/env_spec/budget invalidenv_capability_mismatch: tools required ops groups not provided by Envunrecoverable_error: recovery policy stopped after non-recoverable failure
How to set stop_reason correctly¶
Prefer setting stop reasons on the typed state:
Avoid ad-hoc strings: StateSchema.validate() enforces stop reasons must be one of StopReason.