Skip to content

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

Closed

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.

Activity

  1. self-assigned this
    on Jul 10, 2025
  2. rwese commented on Jul 15, 2025

    @rwese
    Contributor

    a general handling of 529 The service is overloaded would be a good idea, with dynamic wait, incremental wait or similar.

    having the option to set a 'max retry count', 'max delay' would be also great.

  3. adamdotdevin commented on Jul 15, 2025

    @adamdotdevin
    Member

    we should better support 529, before submitting a PR can you look into AI SDK (v5) 529 handling? do they not support retries on these already?

  4. rwese commented on Jul 15, 2025

    @rwese
    Contributor

    I searched, in various ways, found nothing which would handle 529 errors, but I might be missing something.

    https://github.com/vercel/ai/blob/v5/content/docs/07-reference/05-ai-sdk-errors/ai-api-call-error.mdx

  5. aisflat439 commented on Jul 16, 2025

    @aisflat439

    I'm also experiencing this and mentioned it in discord. I'll add the link here.

    https://discord.com/channels/1391832426048651334/1391832428024430645/1395048739936276670

  6. carlesandres commented on Jul 16, 2025

    @carlesandres

    It would be nice to have /retry command to make the "continue" behaviour more obvious. I imagine there can always be backend failures that aren't yet handled properly by opencode or AI-SDK.

  7. alexeypolitov commented on Aug 17, 2025

    @alexeypolitov

    @thdxr look's like this related by new issue? before, when I got "overloaded", i could write like "retry" and it continue execution. for now it restart from scratch

    Image

    https://opencode.ai/s/O5qCRoYM

  8. nesl247 commented on Nov 25, 2025

    @nesl247

    Running into this all the time lately.

  9. rekram1-node commented on Nov 25, 2025

    @rekram1-node
    Contributor

    Doing it

  10. rekram1-node commented on Nov 25, 2025

    @rekram1-node
    Contributor
  11. nesl247 commented on Nov 25, 2025

    @nesl247

    Wow that was fast. Thank you very much!

  12. added a commit that references this issue on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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