More resilient retry policy for Amazon Bedrock rate limiting #330

Open
opened 2026-02-16 17:26:15 -05:00 by yindo · 3 comments
Owner

Originally created by @gabrielcolson on GitHub (Jun 27, 2025).

Originally assigned to: @thdxr on GitHub.

Claude Sonnet 4 juste became available in my AWS region (eu-central-1) and my increase quota request is still pending so I often get rate limited. This is not an issue in Claude Code as they use some sort of exponential backoff and it eventually works but it looks like OpenCode just tries 3 times and stops the generation.

Would be great if we had a more resilient retry policy in OpenCode.

Originally created by @gabrielcolson on GitHub (Jun 27, 2025). Originally assigned to: @thdxr on GitHub. Claude Sonnet 4 juste became available in my AWS region (eu-central-1) and my increase quota request is still pending so I often get rate limited. This is not an issue in Claude Code as they use some sort of exponential backoff and it eventually works but it looks like OpenCode just tries 3 times and stops the generation. Would be great if we had a more resilient retry policy in OpenCode.
Author
Owner

@phenomen commented on GitHub (Jun 27, 2025):

I use the official Anthropic API endpoint and get rate limited all the time. It would be great if OpenCode had:

  1. More retries
  2. A longer pause between retries

I would rather wait a minute for the limit to reset than have the agent drop the task basically immediately.

@phenomen commented on GitHub (Jun 27, 2025): I use the official Anthropic API endpoint and get rate limited all the time. It would be great if OpenCode had: 1) More retries 2) A longer pause between retries I would rather wait a minute for the limit to reset than have the agent drop the task basically immediately.
Author
Owner

@AsocPro commented on GitHub (Jun 27, 2025):

It would be cool if this could be designed in a way that it would work for Claude subscriptions so if a limit was hit and then say I went to bed open code could pick up in a few hours or whenever my limits reset in the 5 hour interval. I don’t know if those limits give any info on when they will reset but it would be cool for it to use the quota for the 5 hour period where I would be sleeping and otherwise not using any tokens.
I don’t know if that would make too crazy of a back off or not but that just would help get more bang for my buck.

@AsocPro commented on GitHub (Jun 27, 2025): It would be cool if this could be designed in a way that it would work for Claude subscriptions so if a limit was hit and then say I went to bed open code could pick up in a few hours or whenever my limits reset in the 5 hour interval. I don’t know if those limits give any info on when they will reset but it would be cool for it to use the quota for the 5 hour period where I would be sleeping and otherwise not using any tokens. I don’t know if that would make too crazy of a back off or not but that just would help get more bang for my buck.
Author
Owner

@kierr commented on GitHub (Oct 8, 2025):

I use the official Anthropic API endpoint and get rate limited all the time. It would be great if OpenCode had:

  1. More retries
  2. A longer pause between retries

I would rather wait a minute for the limit to reset than have the agent drop the task basically immediately.

Retries is now 10, and then there's also #2116

@kierr commented on GitHub (Oct 8, 2025): > I use the official Anthropic API endpoint and get rate limited all the time. It would be great if OpenCode had: > > 1. More retries > 2. A longer pause between retries > > I would rather wait a minute for the limit to reset than have the agent drop the task basically immediately. Retries is now 10, and then there's also #2116
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#330