Skip to content

[Bug]: OpenCode ChatGPT usage-limit failures drop the reset time, so auto-resume never arms #26265

Open

Description

@abdfattahz

Before submitting

Area

apps/server

Steps to reproduce

  1. Connect the OpenCode provider (OpenCode 2.x) to a ChatGPT subscription through OpenAI OAuth.
  2. Run a thread on a ChatGPT-backed OpenAI model, such as openai/gpt-6-astra, until the Codex usage window is exhausted.
  3. Look at the failed thread.

Expected behavior

The usage-limit failure carries the reset time ChatGPT reports. The thread shows "Resets …" with the resume-at-reset and snooze actions, and auto-resume arms for that time.

Actual behavior

The thread fails as usage_limit with no resetAt. It shows "Reset time unavailable; retry manually", hides the resume and snooze actions, and never auto-resumes.

Stored failure:

{"class":"usage_limit","message":"The usage limit has been reached","code":"provider.quota","retryable":null}

ChatGPT does report the reset. Its 429 body is:

{"error":{"type":"usage_limit_reached","message":"The usage limit has been reached","plan_type":"plus","resets_at":1788753614,"resets_in_seconds":57361}}

OpenCode 2 forwards this as error.response.body on session.execution.failed, but the OpenCode 2 adapter (packages/provider-opencode/src/server/v2/adapter.ts) only reads type, message, and status.

Impact

Major degradation or frequent failure

Version or commit

main @ 67661cf

Environment

Linux (Omarchy), T3 Code, OpenCode 2.1.3, ChatGPT Plus via OpenAI OAuth, openai/gpt-6-astra

Workaround

Check the reset time manually (ChatGPT/Codex usage settings) and resend after it passes.

Proposed fix: #26264

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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