-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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.