completed. When one ends failed or timed_out, the session’s status carries two machine-readable signals so your code can branch without parsing prose:
error_code: why the session failed, from a small fixed taxonomy.error: a short, stable, human-readable message matching the code.
outcome: the agent’s own assessment of how the task went, reported together with its final answer. A session can be completed and still not have done what you asked, so check outcome before trusting the answer.
All three appear on status, on the Session object, and on changes.
Error codes
error_code | Meaning | Retry? |
|---|---|---|
environment_error | The session’s environment (browser, desktop) failed to provision or crashed. | Yes, as is. Nothing about your request was wrong. |
no_answer | The agent ran out of budget (max_steps / max_time_s) or stopped without producing an answer. | Yes, with a higher budget or a more focused task. |
answer_validation | The agent answered, but every attempt failed to match the agent’s answer_format. | Maybe. Simplify the schema, or loosen required fields. |
timeout | The session exceeded its maximum allowed time (status is timed_out). | Yes, with a higher max_time_s or a smaller task. |
internal | An unexpected platform-side error. | Yes, once; if it persists, contact support. |
error_code is null unless the session’s status is failed or timed_out, and new codes may be added over time, so treat unknown values like internal.
Python
Outcomes
With its final answer, the agent reports how the task concluded:outcome | Meaning |
|---|---|
success | The task was fully accomplished. |
partial | Some of the task was accomplished, but not all of it. |
infeasible | The task cannot be accomplished as specified (e.g. the requested item does not exist). |
blocked | An external obstacle stopped progress: a login wall, captcha, or missing permissions. |
blocked usually means a human needs to connect an account or a vault; infeasible usually means retrying is pointless), but for high-stakes flows validate the answer itself. outcome is null when the agent ended without reporting one, including all sessions that predate this field.
TypeScript
What you will never see
Theerror message is a stable template derived from error_code, never raw internals: no tracebacks, file paths, or provider error strings. Do not match on the message text; branch on error_code and log the message.
Related
- Session lifecycle for how sessions reach terminal states.
- Errors for HTTP-level error handling (4xx/5xx envelopes, rate limits).
- Structured output for
answer_formatand SDK-side answer validation.