[Bug]: OpenCode ChatGPT usage-limit failures drop the reset time, so auto-resume never arms#26265
Before submitting
- I searched existing issues and did not find a duplicate. (Related: #16366 was closed by #18315, which noted "OpenCode doesn't send a reset time in these events, so none is shown yet". #14169 / #18721 cover the Codex provider, not OpenCode.)
- I included enough detail to reproduce or investigate the problem.
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:
| 1 | {"class":"usage_limit","message":"The usage limit has been reached","code":"provider.quota","retryable":null} |
ChatGPT does report the reset. Its 429 body is:
| 1 | {"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