opencode icon indicating copy to clipboard operation
opencode copied to clipboard

huge retry time

Open xiantang opened this issue 2 months ago • 2 comments

Description

when i use openai model in opencode and it reached ratelimit, shows 447.231667 hours wait to retry!

Image

Plugins

No response

OpenCode version

1.1.13

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

xiantang avatar Jan 13 '26 08:01 xiantang

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

  • #1712: Implement exponential back-off when hitting rate limits
  • #2398: AI_RetryError: Failed after 4 attempts. Last error: Too Many Requests
  • #3525: Quota Limit Exceeded Error is not handled properly

These issues all relate to rate limiting and retry mechanisms when using OpenAI and other model providers. The excessive wait time you're experiencing (447 hours) appears to be a calculation or display issue with how retry times are being communicated to the user.

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Jan 13 '26 08:01 github-actions[bot]

Exponential backoff seems way overkill.

To state the obvious: exponential backoff means OpenCode waits TWICE THE LENGTH OF TIME it waited the last time on every retry.

This means, after only 7 retries, you wait over a minute. On the 8th retry, you wait 2 minutes. ... https://github.com/anomalyco/opencode/issues/1712#issuecomment-3752450455

tgrushka avatar Jan 15 '26 01:01 tgrushka

Well in this case what is happening is your quota was exceeded and we are respecting the retry headers and reporting back to you when the quota will reset effectively, so not an exponetial issue in this example, instead it is the actual amount of time before the quota resets

rekram1-node avatar Jan 15 '26 02:01 rekram1-node

Well in this case what is happening is your quota was exceeded and we are respecting the retry headers and reporting back to you when the quota will reset effectively, so not an exponetial issue in this example, instead it is the actual amount of time before the quota resets

yes because my GitHub copilot was exceeded, but opencode shouldn't count it as seconds should be days

xiantang avatar Jan 15 '26 02:01 xiantang

I think is not a bug but it's an enhancement

xiantang avatar Jan 15 '26 02:01 xiantang

Yeah good point

rekram1-node avatar Jan 15 '26 06:01 rekram1-node

/oc update tui/component/prompt/index.tsx so that we show a slightly prettier message for retries?

Right now it is hardcoded to be seconds but when seconds is really large we should try more human readable times w/ best match (doesnt have to be exact if it is in # of days / weeks range

if it is in minutes try to have seconds there too if possible If it is in hours try to have minutes there too if possible

rekram1-node avatar Jan 15 '26 06:01 rekram1-node

Created PR #8608

New%20session%20-%202026-01-15T06%3A18%3A05.219Z opencode session  |  github run

opencode-agent[bot] avatar Jan 15 '26 06:01 opencode-agent[bot]