Skip to content

feat(app): show the Go limit in a tray that grows out of the composer - #58008

Draft
kitlangton wants to merge 4 commits into
devfrom
go-limit-composer-tray
Draft

kitlangton wants to merge 4 commits into
devfrom
go-limit-composer-tray

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

▶ Pitch (phone, 64 s):

pr-58008-phone.mp4

Desktop: https://github.com/user-attachments/assets/ae325f30-6f7a-4279-94ba-4b03f88d4e5f

Head: 573d8806067612e3be785e0d3e7ffc166181e2b2

Confidence Size Affects API change Undo Reviewed by
Medium · Go-limit e2e passes, no outside review yet +290/−39 · 5 files, on #57897's 2 commits desktop No: app UI only One revert Opus → none yet

Risk: Based on beta (where the grow animation lives) with #57897's commits underneath. I'd merge #57897 first. The Go limit is kept in memory, so after a reload a free-limit error opens the Subscribe dialog again. Beta's app e2e legs and typecheck were already red, and build (windows) failed on a pkg.pr.new 404.

Not verified: Use credits opening the Console (not clicked on camera). Recorded against a mock gateway that returns GoUsageLimitError and FreeUsageLimitError, not the real Go service. Also, on a brand-new session's first message the error can arrive before the session screen mounts, so neither the old dialog nor the tray shows. That was already true before this change.

What it does. When a Go subscriber hits their Go limit, a tray grows out from under the composer. It says when Go is back and offers two buttons: Use credits and Switch to a free model, which keeps the prompt. If they switch to a free model and then run out of free messages too, the tray says both limits are reached, shows when each comes back, and leaves only Use credits.

Stack: rebased onto the latest beta with #57897's commits underneath, including "drop the Go limit dialog". #57897 types the errors and removes the Desktop Go dialog, and this PR adds the tray that replaces it. Once #57897 lands on dev and dev is merged into beta, this PR reduces to the tray commit alone. It's based on beta because the grow animation (#57559) only exists there.

How it works.

  1. session.step.failed with provider.go-limit opens SessionGoLimitTray and records the session in goLimited with its reset time.
  2. The tray uses the same Grow (fade) as the queue panel and tucks under the composer the same way. A small ring empties as the reset nears.
  3. Switch to a free model picks the first free OpenCode model from the composer's model list and closes the tray.
  4. A provider.free-limit in a session whose Go limit still holds goes to the tray (both limits) instead of the free-tier Subscribe dialog.
  5. The muted timeline line from fix: type the Go and ChatGPT usage limits #57897 stays.

Risk. Desktop UI only. Free-tier users without Go still get the free-limit dialog. goLimited lives in memory, so after a reload a free-limit error shows the normal dialog until the next Go-limit error. Rebasing onto beta touched beta's budget-limit code: the timeline row now matches free-limit/go-limit as usage limits, alongside budget-limit and model-budget-limit.

Proof.

  • Recorded in the real app against a hermetic server and a mock gateway (Go limit, then free limit); see the pitch above. The pitch predates the rebase, but the tray code is unchanged.
  • e2e/regression/composer.spec.ts: 25 pass. These include the tray test (free-model switch keeps the prompt, both-limits state), the ChatGPT dialog test and the free-limit test, which used to fail on beta. 2 failures are unrelated and already fail on beta: the multiline paste tests.
  • bun test src/session/usage-exceeded-dialogs.test.ts: 4 pass. Core session-error: 12 pass. session-ui timeline: 92 pass. TUI: 51 pass.
  • Typecheck clean for app, core, session-ui, tui and ui.

kitlangton added a commit that referenced this pull request Oct 24, 2026
Desktop hands the prompt back and leaves the muted timeline line on a Go limit. The tray in #58008 is the only Go-limit UI.
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.
Desktop hands the prompt back and leaves the muted timeline line on a Go limit. The tray in #58008 is the only Go-limit UI.
Replaces the Go limit dialog with a tray above the composer: when Go is back, Use credits, and Switch to a free model, which keeps the prompt. If free models run out too while the Go limit holds, the tray says so with both reset times instead of opening the free-tier upsell.
@kitlangton
kitlangton force-pushed the go-limit-composer-tray branch from c70d6f2 to 573d880 Compare October 24, 2026 15:26
Base automatically changed from beta to dev October 26, 2026 03:56

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant