RunResult
What a run ended with.
thread is the Thread handle in both languages: read it (usage(), timeline(), fork()) or pass it back to run() to continue. In TypeScript the handle holds functions, so it can't be structured-cloned; to send a result elsewhere, send thread.id and thread.branch. The HTTP form is host-api RunOutcome (ids instead of handles).
A union discriminated by status.
completed
status"completed"required"completed": the run finished, and output holds its final answer.
outputOutputrequiredThe final answer: the text of the run's last lead turn (after the last wake, when members or background subagents reported), or in TypeScript the value parsed by the agent's output schema when it has one. Earlier answers stay in the thread's timeline.
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, or on a member it started that parked; 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.