OpenProgram Docs

Error reasons up to the UI

Flattened to a string, a rate limit, a rejected key and an overlong conversation look alike and offer nothing to do. Scope: the main chat-turn streaming error. Retry and compact-failure strings stay plain.

reasonEnumRetryableChat headline
rate_limitRATE_LIMITyesRate limited — try again in {retry_after_s}s
authAUTHENTICATIONnoYour API key was rejected — check it in Settings → Model services
authzAUTHORIZATIONnoNot authorized — check your plan / access for this model
blockedNETWORK_BLOCKnoThe provider's network refused the address you connect from — switch your proxy node or turn off the VPN, then try again
contextCONTEXT_LENGTHnoThis conversation is too long — compact it or start a new chat
policyCONTENT_POLICYnoThe provider blocked this request (content policy)
providerPROVIDER_INTERNALyesTemporary provider / network error — try again
transportTRANSPORTyesTemporary provider / network error — try again
timeoutTIMEOUTnoThe request timed out — try again
invalidINVALID_REQUESTnoraw message only
unknownUNKNOWNnoraw message only

A memory policy error is unknown and not retryable; error_kind: memory_unavailable names it, so the reason stays inside the set.

Event

{"type": "error", "content": "<text>", "reason": "<reason>",
 "retryable": true, "retry_after_s": 30.0}

Where it happens

PlaceDoes
models/providers/utils/failures/errors.pyErrorReason, LLMError, classify_error, taxonomy_fields; stream_retry drives backoff from them. error_kind gives a narrower stable name (stream_idle, stream_total, model_unavailable, auth…) found through wrapped causes
runtime/agent/loop/driver.pyAgent boundary; sets error_reason, error_retryable, error_retry_after_s on the message. A refusal the provider states outright (no credit or quota, a rejected or expired sign-in, a plan or region it does not serve) is logged as one warning line with the provider and the reason; any other failure keeps its traceback on stderr
runtime/conversation/turn_runtime/error_path.pyChat turn; classifies, stores error_metadata, fills TurnResult
apps/web/components/chat/messages/bubbles/assistant-bubble.tsxHeadline by errorReason, raw message below
interfaces/server/transcript/rows.pyProjects the fields from a stored message, so a reload keeps the headline

API consumers, logs and other channels read the reason too. No change to auto-retry policy; this only exposes the fields. A wider audit of except Exception sites is separate.

Verifying

A rejected key gives auth, fatal. A 429 gives rate_limit, retryable, with the hint. An oversized context gives context, fatal. Unit tests cover the mapping and that the Agent boundary keeps an LLMError's reason.

End to end needs a repeatable failure on the model the frontend selected, since it sends its own choice: an expired key for auth, or an OpenRouter :free model that returns 503 for provider.

Last updated · 2026-11-25