Skip to content

handle LLM overload errors (e.g. {"type": "overloaded_error", "message": "Overloaded"}) #833

@kavhnr

Description

@kavhnr

When using opencode with Anthropic, I occasionally hit this response from the model:

{"type": "overloaded_error", "message": "Overloaded"}

This is the error Anthropic throws when it has capacity issues. Right now, opencode surfaces the error and halts. Manually typing continue will usually succeed on the next try, which suggests the failure is transient and recoverable.

Proposed behavior

Rather than require manual input, opencode could intercept this response and retry the request automatically. A minimal first pass might:
• Catch overloaded_error responses
• Retry the failed step after a short delay
• Limit retries to a sane default (e.g. 2–3 attempts) to avoid blocking or infinite loops

This would eliminate the need for manual intervention and improve flow, especially for longer sessions.

Next steps

If this direction makes sense, I can put up a PR that adds basic retry logic around the model call. Happy to scope it to whatever level of configurability or error handling you want to support longer term.

Just, let me know.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions