Run Outcome • AI Agent SDK
Structured run outcome types for agent execution results.
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
from praisonaiagents import run_outcomeClasses
Typed terminal reasons for an autonomous run.
AgentRunOutcomeStructured outcome for agent execution, validation, and handoff operations.
RunTerminalOne authoritative way a run ended — a closed discriminated union.
Functions
Map a `TerminationReason (or its string value) to a RunStatus`.
Convert legacy validation decision strings to typed RunStatus.
is_sticky()Whether `outcome` can never be overwritten by a later observation.
Fold a newly-observed terminal into the current one (refine-only).
collapse()Project a `RunTerminal onto the existing RunStatus` vocabulary.
Constants
| Name | Value |
|---|---|
_STICKY_SOURCES | frozenset({'external', 'run_budget', 'superseded'}) |