Skip to main content

Troubleshooting: agent runtime errors

An agent run returns a non-2xx envelope, an SSE stream aborts with an error event, or a conversation shows a failed turn in the Live tab. The error.code in the response tells you which gate fired. This page covers the six codes the agent runtime throws, in the order you will meet them. The full list of platform codes lives in the error reference; this page gives you the fix for each agent code. A typical envelope looks like this — the code is the stable identifier you key on, never the message text:

Decision table — agent error → fix

Do not retry the deterministic codes

Three of these codes re-fail deterministically — a retry re-runs the same gate and returns the same code:
  • AGENT_NOT_CONFIGURED — the prompt is still missing until you write one.
  • INVALID_MODEL — the model id is still illegal until you pick a supported one.
  • A capped or gated run (cost caps, guardrails) — same input, same gate.
Retry only the transient ones: LLM_PROVIDER_ERROR (provider blip), AGENT_RESPONSE_INVALID (occasionally), and AGENT_EXECUTION_TIMEOUT after you have removed the loop cause — otherwise the retry burns the 30-second ceiling again. Live-stream clients key on the same sanitised code set: the SSE path maps upstream failures to stable machine codes (LLM_RATE_LIMITED, LLM_OVERLOADED, AGENT_EXECUTION_TIMEOUT, …) so your client can branch on code, not on a message string.

Distinguish timeout from runaway loops

AGENT_EXECUTION_TIMEOUT has two very different causes and they pair with different fixes:
  • A genuinely slow agent — a deep-research prompt with a legal 30 s budget. Fix: set config.latency_budget.turn_ms (up to 180 000 ms) on the agent and retry.
  • A runaway tool loop — the agent chains the same tool until the ceiling trips. Fix: inspect the run in the Live tab, find the repeating tool call, and correct the tool or the prompt that re-invokes it. Raising the ceiling hides the loop rather than fixing it; the parallel tool_loop_limit cap exists for that case.

When to escalate

Escalate to support when:
  • The same agent returns AGENT_ERROR with an empty or opaque message and you have ruled out the table above.
  • LLM_PROVIDER_ERROR persists after the status page reports all operational.
  • AGENT_EXECUTION_TIMEOUT fires on a turn with no tool calls at all — that should not reach the ceiling.
Include the request_id from the meta block of the failing response, the agent id, and the conversation id. The request id threads through the chat, stream, and invoke paths, so support can pull the executor-side trace without a back-and-forth.

See also