Before submitting#
Area#
apps/server
Steps to reproduce#
- Connect the OpenCode provider (OpenCode 2.x) to a ChatGPT subscription through OpenAI OAuth.
- Run a thread on a ChatGPT-backed OpenAI model, such as
openai/gpt-6-astra, until the Codex usage window is exhausted.
- 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 @ 67661cfb
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