Skip to content
docsv0.42.1

RunTermination

Producer-owned exit observation; it grants no completion, approval, or authority.

RunTermination::__construct()

public function __construct(Milpa\AiGateway\RunEnd $reason, ?array $receipt = null, ?Milpa\AiGateway\AnswerVerdict $answerVerdict = null, ?array $cause = null):

Parameters

Parameters of __construct()
NameTypeDescription
$reasonMilpa\AiGateway\RunEnd
$receipt(array<string, mixed> | null)the original progress receipt, when stalled
$answerVerdict?Milpa\AiGateway\AnswerVerdict
$cause(array<string, mixed> | null)what a failed run died on, when it was the model's endpoint ({@see causeOf()}); null for every other ending

RunTermination::causeOf()

public static function causeOf(Throwable $error): ?array

What a failure says about the model's endpoint, or null when it was not the endpoint's. A run that died on its endpoint used to end as a bare `failed`: the 404 lived only in the terminal of whoever ran the leg, and the panel showed a failed leg with no reason (greenhouse evidence/1069 §C1). The chain is walked, because the streaming path wraps what it caught once more.

Parameters

Parameters of causeOf()
NameTypeDescription
$errorThrowable

RunTermination::toArray()

public function toArray(): array

Export the reason, its optional producer receipt, and — only when there is one — the endpoint's cause.