Repository navigation
Conversation
Jinwoo-H
force-pushed
the
jinwoo/chat-account-follow
branch
from
October 31, 2026 10:08
2526da0 to
6150d98
Compare
…tice When a Claude or Codex chat stops at its usage limit, the notice now offers "Switch to <account> · N% left and continue" for the signed-in account on this machine with the most room, using the usage figure the status bar shows. One click selects that account exactly as the status bar does (including its offer to restart terminals on the old account) and sends the existing usage-limit Continue. With no other account, it offers Add account, which opens Settings › AI Provider Accounts. The status bar's select step moves to a shared helper so both use the same code.
Jinwoo-H
force-pushed
the
jinwoo/chat-usage-limit-switch
branch
from
October 31, 2026 10:08
0f859c8 to
3c7ba75
Compare
9 tasks done
10 of 11 tasks
9 of 11 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When a chat stops because your account hit its usage limit and you have another signed-in account with room left, the notice now has a button that switches to that account and picks the chat back up. If you have no other account, the button takes you to where you add one.
What Changed
Before: the usage-limit notice in a native chat only said the limit was hit. To keep going you had to open the status bar, switch accounts by hand, then retype or resend your message.
After:
Mechanism: the status bar's switch steps were pulled out into
provider-account-selection.tsand are now used by the status bar menus and by the notice, so there is one switch path. A small hook reads the same account roster and per-account usage the status bar reads.Why
The notice is where the user is stuck, so the fix belongs there. Reusing the status bar's switch keeps one definition of "switch account" (restart prompts, settings refresh, feature tracking) instead of a second one that could drift. The button only appears when the move will actually help (the other account has room), so it never sends a message straight into another limit.
Linked Issue
Stacked on #36649.
Visual Proof
Switch offered (light / dark):


After one click: the picker moved, the chat continued on the new account:

No other account (light / dark), and where Add account goes:



Testing
Ran an isolated dev build on macOS with two test Codex account homes holding fake credentials and a stub Codex that reports per-account usage and hits the limit on one account. Confirmed the button shows the other account's remaining percent, one click switches the status bar and continues the chat, and with one account the notice shows Add account and opens AI Provider Accounts.
Unit tests for the account choice (most room, tightest window, unknown or zero room hidden, remote hidden), the switch-then-continue order, and the notice rendering.
pnpm tc, native-chat and status-bar tests, oxlint, changed-code-quality and the pr.yml static checks pass locally.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)