Retry error #395

Closed
opened 2026-02-16 17:26:35 -05:00 by yindo · 12 comments
Owner

Originally created by @openconstruct on GitHub (Jun 29, 2025).

Originally assigned to: @thdxr on GitHub.

I'm using opencode on an amazon ec2 instance with bedrock inference. I got it all set up and working, but every few seconds I get:
AI_RetryError: Failed after 3 attempts, Last error: undefined: Too many tokens, please wait before trying again.

Seems to be worse with opus than sonnet (4.0 for both)

Originally created by @openconstruct on GitHub (Jun 29, 2025). Originally assigned to: @thdxr on GitHub. I'm using opencode on an amazon ec2 instance with bedrock inference. I got it all set up and working, but every few seconds I get: AI_RetryError: Failed after 3 attempts, Last error: undefined: Too many tokens, please wait before trying again. Seems to be worse with opus than sonnet (4.0 for both)
yindo closed this issue 2026-02-16 17:26:35 -05:00
Author
Owner

@thdxr commented on GitHub (Jun 29, 2025):

can you try again with v0.1.163

@thdxr commented on GitHub (Jun 29, 2025): can you try again with v0.1.163
Author
Owner

@openconstruct commented on GitHub (Jun 29, 2025):

Still happening with 0.1.165 if the fix is in that version specifically I can downgrade.

It happens on opus almost every other message, on sonnet I can do a little bit before it messes up.

@openconstruct commented on GitHub (Jun 29, 2025): Still happening with 0.1.165 if the fix is in that version specifically I can downgrade. It happens on opus almost every other message, on sonnet I can do a little bit before it messes up.
Author
Owner

@thdxr commented on GitHub (Jun 30, 2025):

can you do /share and DM me with the info on X

@thdxr commented on GitHub (Jun 30, 2025): can you do /share and DM me with the info on X
Author
Owner

@jluisrojas commented on GitHub (Jul 2, 2025):

I'm also struggling to use it with bedrock, claude code appears to handle this more effectively with an exponential backoff for retries

@jluisrojas commented on GitHub (Jul 2, 2025): I'm also struggling to use it with bedrock, claude code appears to handle this more effectively with an exponential backoff for retries
Author
Owner

@jluisrojas commented on GitHub (Jul 2, 2025):

This what I believe claude code does to avoid this:

Image
@jluisrojas commented on GitHub (Jul 2, 2025): This what I believe claude code does to avoid this: <img width="1728" alt="Image" src="https://github.com/user-attachments/assets/968b193b-9142-43c9-a1af-3db702c4e0c0" />
Author
Owner

@thdxr commented on GitHub (Jul 2, 2025):

what is your rate limit allocated with bedrock? default is low but they will increase it

@thdxr commented on GitHub (Jul 2, 2025): what is your rate limit allocated with bedrock? default is low but they will increase it
Author
Owner

@jluisrojas commented on GitHub (Jul 3, 2025):

@thdxr we have limits of 4 request per minute and 200,000 inference tokens per minutes in Bedrock with Sonnet 4

@jluisrojas commented on GitHub (Jul 3, 2025): @thdxr we have limits of 4 request per minute and 200,000 inference tokens per minutes in Bedrock with Sonnet 4
Author
Owner

@thdxr commented on GitHub (Jul 3, 2025):

200K per minute should be fine unless you have multiple people using it. surprised you run into this

@thdxr commented on GitHub (Jul 3, 2025): 200K per minute should be fine unless you have multiple people using it. surprised you run into this
Author
Owner

@thdxr commented on GitHub (Jul 3, 2025):

i bumped it to 10 retries in v0.1.183 let me know if that's better

@thdxr commented on GitHub (Jul 3, 2025): i bumped it to 10 retries in v0.1.183 let me know if that's better
Author
Owner

@jluisrojas commented on GitHub (Jul 3, 2025):

@thdxr yes its better with 10 retries, I haven't encountered any issues all day

@jluisrojas commented on GitHub (Jul 3, 2025): @thdxr yes its better with 10 retries, I haven't encountered any issues all day
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@evatt-harvey-salinger-ai commented on GitHub (Jan 9, 2026):

I'm getting this a bunch as well.
"undefined: Too many tokens, please wait before retrying. [retrying is 3s attempt number #2]

This seems related to this:
https://code.claude.com/docs/en/amazon-bedrock#5-output-token-configuration

@evatt-harvey-salinger-ai commented on GitHub (Jan 9, 2026): I'm getting this a bunch as well. "undefined: Too many tokens, please wait before retrying. [retrying is 3s attempt number #2] This seems related to this: https://code.claude.com/docs/en/amazon-bedrock#5-output-token-configuration
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#395