RunResult
The HTTP form is host-api RunOutcome (ids instead of handles).
In TypeScript, thread is a ThreadRef (id, branch, store): pass it to openThread for the full Thread handle. In Python it is the Thread handle.
A union discriminated by status.
completed
status"completed"required"completed": the run finished, and output holds its final answer.
outputOutputrequiredThe final answer: the last reply's text, or in TypeScript the value parsed by the agent's output schema when it has one.
threadThreadrequiredA thread positioned at one branch.
parked
status"parked"required"parked": the run is waiting on a person, such as an approval or an effect whose outcome is unknown; pending lists what it waits on. Answer them with the Thread methods to let it continue.
reasonParkedEvent.data.reasonrequiredawaiting_input: an ask_user question; the address is {kind: input, id: <call_id>}.
pendingreadonly ParkAddress[]requiredWhat a parked branch waits on; resumed must name the same address.
threadThreadrequiredA thread positioned at one branch.
cancelled
status"cancelled"required"cancelled": the thread was cancelled before the run finished.
threadThreadrequiredA thread positioned at one branch.
failed
status"failed"required"failed": the run ended with an error; error says which.
error{ code: RunErrorCode; message: string }requiredWhy the run failed: a code and a readable message.
error.codeRunErrorCoderequiredWhat went wrong, for example model_unavailable, max_turns, output_invalid or branch_busy.
error.messagestringrequiredA readable explanation of the failure, for logs and people.
threadThreadrequiredA thread positioned at one branch.
budget_exhausted
status"budget_exhausted"required"budget_exhausted": a budget limit was reached before the next model request; budget says which.
budgetBudgetExceededEvent.datarequiredWhich limit was hit and its value, how much was used, and whether the budget was this thread's own or an ancestor's.
threadThreadrequiredA thread positioned at one branch.
handed_off
status"handed_off"required"handed_off": the agent handed the conversation to another agent; to_thread is that agent's thread.
threadThreadrequiredA thread positioned at one branch.
toThread / to_threadThreadrequiredA thread positioned at one branch.