Skip to content

feat(native-chat): switch accounts and continue from a usage-limit notice - #36656

Open
Jinwoo-H wants to merge 1 commit into
jinwoo/chat-account-followfrom
jinwoo/chat-usage-limit-switch
Open

Jinwoo-H wants to merge 1 commit into
jinwoo/chat-account-followfrom
jinwoo/chat-usage-limit-switch

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​239 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​239
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​370 $\color{#cf222e}{\Huge{\mathbf{−}}}$​68 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​302

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:

  • The notice shows Switch to · % left and continue when another signed-in account of the same agent (Claude or Codex) has room. N is the same remaining-usage figure the status bar shows, taken from that account's tightest window. Among several accounts, the one with the most room is offered.
  • One click switches the account picker exactly as the status bar does (same restart prompts for other running sessions), then resends the stopped message. Because of Native chats follow the account picker and keep the conversation #36649 (which this stacks on), the chat moves to the new account and the transcript shows "Now on · same conversation".
  • With no other account, the notice shows Add account, which opens Settings › AI Provider Accounts at that agent's section.
  • If other accounts exist but none has room, or their usage is unknown, nothing extra is shown.

Mechanism: the status bar's switch steps were pulled out into provider-account-selection.ts and 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):
10-limit-switch-light.png
11-limit-switch-dark.png

After one click: the picker moved, the chat continued on the new account:
12-after-switch-continued-light.png

No other account (light / dark), and where Add account goes:
13-limit-add-account-light.png
14-limit-add-account-dark.png
15-add-account-opens-settings.png

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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Follow-up: remote servers and WSL get no button yet. Per-account remaining usage is only cached for this machine's accounts (the status bar has the same limit), so the notice stays as it was rather than guess. Offering the switch there needs that usage read from the host that runs the agent.
  • Mixed versions: renderer only; no new wire fields.
  • Monochrome outline button from the shadcn primitives, per the style guide.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@Jinwoo-H
Jinwoo-H force-pushed the jinwoo/chat-account-follow branch from 2526da0 to 6150d98 Compare October 31, 2026 10:08
…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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant