GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bug: Claude/Anthropic 500/502/503/504 server errors are not retried · Issue #21422 · anomalyco/opencode

Bug: Claude/Anthropic 500/502/503/504 server errors are not retried #21422

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
Bug: Claude/Anthropic 500/502/503/504 server errors are not retried#21422
Copy link
Assignees
rekram1-node
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)

Description

@rich-jojo
rich-jojo
opened on Apr 8, 2026
Issue body actions

What happened?

When Anthropic's API returns a transient server error (HTTP 500, 502, 503, or 504), OpenCode immediately fails with no retry:

{"type":"api_error","message":"Claude API returned a server error. This is usually temporary — try again in a moment."}

The same infrastructure already retries 429 and 529 — but 500/502/503/504 are silently dropped.

Root cause

parseAPICallError() in packages/opencode/src/provider/error.ts trusts input.error.isRetryable from the Vercel AI SDK for non-OpenAI providers. The @ai-sdk/anthropic package only sets isRetryable: true for 429 and 529. HTTP 500/502/503/504 get isRetryable: false, so SessionRetry.retryable() returns undefined and the retry loop exits.

OpenAI already has a isOpenAiErrorRetryable() override — the same pattern needs to apply universally.

Steps to reproduce

  1. Configure Anthropic as provider
  2. Trigger or wait for a 500/502/503/504 response (during outages or high load)
  3. Observe: immediate error with no retry attempt

Expected behavior

OpenCode should retry 500/502/503/504 with exponential backoff, the same as 429/529.

Activity

  1. github-actions
    assigned
    rekram1-node
    on Apr 8, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 8, 2026
  3. github-actions commented on Apr 8, 2026

    @github-actions
    github-actionsBot
    on Apr 8, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • Claude/Anthropic 500/502/503/504 server errors are not retried #21420: Identical report — same title, same root cause analysis, same fix suggestion (appears to be a double-submission)
    • Anthropic 5xx errors incorrectly marked non-retryable, stopping agent loop #19394: Anthropic 5xx errors incorrectly marked non-retryable, stopping agent loop — same root cause and same proposed fix in error.ts
    • fix: 5xx errors from non-standard providers are not retried #19203: 5xx errors from non-standard providers are not retried — same underlying problem of non-retryable 5xx classification
    • [FEATURE]: retry automatically after internet server error #19100: Feature request for automatic retry after server errors — same user-facing behavior request

    Please check if any of these already cover your report.

  4. rich-jojo
    closed this as a duplicateof Claude/Anthropic 500/502/503/504 server errors are not retried #21420 on Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.