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.

outputOutputrequired

The final answer: the last reply's text, or in TypeScript the value parsed by the agent's output schema when it has one.

threadThreadrequired

A 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.reasonrequired

awaiting_input: an ask_user question; the address is {kind: input, id: <call_id>}.

pendingreadonly ParkAddress[]required

What a parked branch waits on; resumed must name the same address.

threadThreadrequired

A thread positioned at one branch.

cancelled

status"cancelled"required

"cancelled": the thread was cancelled before the run finished.

threadThreadrequired

A thread positioned at one branch.

failed

status"failed"required

"failed": the run ended with an error; error says which.

error{ code: RunErrorCode; message: string }required

Why the run failed: a code and a readable message.

error.codeRunErrorCoderequired

What went wrong, for example model_unavailable, max_turns, output_invalid or branch_busy.

error.messagestringrequired

A readable explanation of the failure, for logs and people.

threadThreadrequired

A 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.datarequired

Which limit was hit and its value, how much was used, and whether the budget was this thread's own or an ancestor's.

threadThreadrequired

A 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.

threadThreadrequired

A thread positioned at one branch.

toThread / to_threadThreadrequired

A thread positioned at one branch.

Edit on GitHub

On this page