Skip to content

Subscription-quota 429s are retried, burning the user's quota window #32120

Closed as not planned

Description

@dylan-conlin

Summary

When a subscription-auth provider returns a 429 because the user's
subscription quota is exhausted (not a transient per-second rate limit), the
retry path treats it like any other retryable rate-limit and retries. Each retry
hits the same exhausted quota, so it can't succeed — it only spends more of the
user's already-depleted window and delays the clear "wait for reset" signal the
user needs to see.

This affects any subscription-auth user, not a single routing setup: a
quota-exhaustion 429 is fundamentally non-retryable until the quota resets, and
retrying is strictly harmful.

Distinguishing quota-exhaustion from transient rate-limit

A transient rate-limit 429 carries a retry-after / retry-after-ms header (or
a structured error code/error body) and should be retried. A
subscription-quota 429 has no retry-after header and a plain
{ detail: "...rate limit..." }-style body. The classifier keys on exactly that:
429 + no retry-after header + no code/error field + a detail string
matching /rate limit/i ⇒ quota exhaustion ⇒ isRetryable: false with a
user-facing "Subscription quota exhausted — wait for your quota to reset" message.

Affected code

  • packages/opencode/src/provider/error.ts — parseAPICallError / the retryable
    classification; quota-exhaustion 429s currently fall through to the generic
    retryable path.

Reference implementation

Implemented and test-covered downstream (isSubscriptionQuota429() guard in
error.ts + test/session/retry.test.ts). Happy to open a PR.

Activity

  1. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The issue does not use one of the required issue templates (Bug Report, Feature Request, or Question). Please resubmit using the Bug Report template, which requires fields such as Description, Steps to Reproduce, OpenCode version, Operating System, and Terminal.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Jun 13, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions