Repository navigation
fix(app): type the Go and ChatGPT usage limits so their dialogs fire - #57897
kitlangton wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
The change looks sound. Core now gives the Console Go-limit 429 and ChatGPT's subscription_sharing_usage_limit_exceeded their own error types, and Desktop and the TUI match on the type instead of a copied message. The removed session.status account_rate_limit listener had nothing in v2 feeding it, so removing it loses nothing.
I couldn't verify it end to end: the simulated model can only stream, so it can't return a real 429 with a GoUsageLimitError body. The new core, session-ui and TUI tests pass, and typecheck is clean in core, app, tui and session-ui. The Desktop dialog unit test fails the same way on the base (a solid-js server-side environment error), so that isn't caused by this change. Could you add before/after screenshots of the TUI notice and the Desktop "Go limit reached" dialog?
Public API: the error.type on session.step.failed events (and stored assistant errors) changes in two cases:
- Console
GoUsageLimitError:provider.quota→provider.go-limit, and its message is now core's own text - ChatGPT
subscription_sharing_usage_limit_exceeded: whatever type the failure got before (e.g.provider.invalid-request/provider.unknown) →provider.chatgpt-limit
The schema's type is a free string, so nothing breaks structurally. Clients or plugins that matched provider.quota for Go limits, or the old type for ChatGPT limits, would need to match the new values.
No blocking concerns.
Related: #56798
core now classifies the Console's GoUsageLimitError 429 as provider.go-limit (keeping retryAfterMs) and ChatGPT's subscription_sharing_usage_limit_exceeded as provider.chatgpt-limit. Desktop opens 'Go limit reached' with the reset time, leaves a muted timeline line and hands the prompt back; the ChatGPT dialog matches the typed error instead of a stale copied string. The TUI restores the prompt and shows a muted Go-limit notice instead of a red error and failure toast.
44ad706 to
9228371
Compare
…pe the Go notice to the status line
Desktop's "Go limit reached" and ChatGPT usage dialogs never fired in v2.
session.statusretry reason (account_rate_limit) that nothing publishes in v2, so a Go subscriber hitting the Console'sGoUsageLimitError429 got a red error and lost their prompt. Core now classifies that body asprovider.go-limit(keepingretryAfterMs), the same way feat(core): typed free-limit error with reset time #57146 typesprovider.free-limit. Desktop shows Go limit reached with the reset time, links "Open settings" to the workspace's Console Go page (from the body'smetadata.workspace), leaves a muted timeline line, and hands the prompt back.isChatGPTUsageLimitcompared against an older copy of the message than core sends. Core now tagssubscription_sharing_usage_limit_exceededasprovider.chatgpt-limitand the dialog matches on that type, never a copied string.Tests: core classification (real Console body +
retry-after), Go-limit link parsing, timeline projection, TUI notice + toast suppression, and a Desktop e2e for both dialogs.Added by the opencode bot (AI-generated).
Related: #56798
Public API: session.step.failed error.type: Go Console limit provider.quota → provider.go-limit; ChatGPT usage limit → provider.chatgpt-limit (structurally compatible; consumers matching the old types need updating)