run_outcome
AI Agent Structured run outcome types for agent execution results. Provides a typed, closed discriminant union for agent run completions, task validation outcomes, and handoff results across the SDK. Replaces freeform string-based validation outcomes with type-safe status values that enable exhaustive error handling and structured metadata.Import
Classes
TerminationReason
Typed terminal reasons for an autonomous run.
AgentRunOutcome
Structured outcome for agent execution, validation, and handoff operations.
RunTerminal
One authoritative way a run ended — a closed discriminated union.
Functions
termination_to_run_status()
Map a
TerminationReason (or its string value) to a RunStatus.validate_decision_string()
Convert legacy validation decision strings to typed RunStatus.
is_sticky()
Whether
outcome can never be overwritten by a later observation.merge_run_terminal()
Fold a newly-observed terminal into the current one (refine-only).
collapse()
Project a
RunTerminal onto the existing RunStatus vocabulary.
