Skip to content

fix(opencode): stop retrying non-transient rate limits#24013

Open
eeshm wants to merge 1 commit intoanomalyco:devfrom
eeshm:fix/non-transient-rate-limit-retry
Open

fix(opencode): stop retrying non-transient rate limits#24013
eeshm wants to merge 1 commit intoanomalyco:devfrom
eeshm:fix/non-transient-rate-limit-retry

Conversation

@eeshm
Copy link
Copy Markdown

@eeshm eeshm commented Apr 23, 2026

Issue for this PR

Closes #24011

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

retryable() trusted the AI SDK's isRetryable flag for 429 errors, which is always true, even for weekly/monthly quota limits that won't resolve with backoff. Added a message check for "weekly", "monthly", "exceeded your" to return undefined (stop) instead of retrying forever.

How did you verify your code works?

  • bun typecheck passes
  • traced the code path: weekly limit 429 -> retryable() now returns undefined -> policy() stops
  • manually verified behavior

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a potentially related PR:

Related PR:

This PR is related because it also deals with 429 rate limit handling and the isRetryable logic, though it approaches the problem from the opposite angle (ensuring transient 429s are retried). Your PR #24013 refines this further by distinguishing between transient rate limits (backoff-able) and non-transient quota limits (weekly/monthly).

No other duplicate PRs found addressing the exact same issue.

@eeshm eeshm force-pushed the fix/non-transient-rate-limit-retry branch from 6f29d90 to 0997749 Compare April 23, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session retries forever on weekly rate limit errors

1 participant