[PR #1027] [CLOSED] feat: Add retry mechanism for Anthropic overloaded errors #9781

Closed
opened 2026-02-16 18:14:09 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1027
Author: @tito
Created: 7/15/2025
Status: Closed

Base: devHead: tito/fix-anthropic-overloaded-error


📝 Commits (1)

  • eba695b fix: handle anthropic overloaded error

📊 Changes

3 files changed (+107 additions, -34 deletions)

View changed files

📝 packages/opencode/src/config/config.ts (+30 -0)
📝 packages/opencode/src/session/index.ts (+69 -34)
📝 packages/opencode/src/session/message-v2.ts (+8 -0)

📄 Description

Implement automatic retry with exponential backoff when Anthropic returns {"type": "overloaded_error"} responses, by checking the error message on overloaded_error inclusion.

Changes

  • Add ServiceOverloadedError type to properly categorize these errors
  • Implement configurable retry logic with exponential backoff and jitter
  • Add retry configuration schema with sensible defaults (20 retries, 30s max delay)

Configuration

We can now configure retry behavior in opencode.json:

{
  "retry": {
    "maxRetries": 20,
    "initialDelay": 1000,
    "maxDelay": 30000
  }
}

Closes #833


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1027 **Author:** [@tito](https://github.com/tito) **Created:** 7/15/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `tito/fix-anthropic-overloaded-error` --- ### 📝 Commits (1) - [`eba695b`](https://github.com/anomalyco/opencode/commit/eba695b0467daaab18a6363067c430717741640b) fix: handle anthropic overloaded error ### 📊 Changes **3 files changed** (+107 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/config/config.ts` (+30 -0) 📝 `packages/opencode/src/session/index.ts` (+69 -34) 📝 `packages/opencode/src/session/message-v2.ts` (+8 -0) </details> ### 📄 Description Implement automatic retry with exponential backoff when Anthropic returns `{"type": "overloaded_error"}` responses, by checking the error message on `overloaded_error` inclusion. **Changes** - Add `ServiceOverloadedError` type to properly categorize these errors - Implement configurable retry logic with exponential backoff and jitter - Add retry configuration schema with sensible defaults (20 retries, 30s max delay) **Configuration** We can now configure retry behavior in opencode.json: ```json { "retry": { "maxRetries": 20, "initialDelay": 1000, "maxDelay": 30000 } } ``` Closes #833 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:09 -05:00
yindo closed this issue 2026-02-16 18:14:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9781