Skip to content

fix(interactive): footer names the serving account when the pin is blocked (#5983) - #6222

Merged
code-yeongyu merged 5 commits into
code-yeongyu:mainfrom
surlymochan:fix/5983-footer-serving-account
Nov 10, 2026
Merged

code-yeongyu merged 5 commits into
code-yeongyu:mainfrom
surlymochan:fix/5983-footer-serving-account

Conversation

@surlymochan

@surlymochan surlymochan commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #5983: the footer kept naming the pinned account after a usage-limit refusal moved every later turn to a sibling, and it ignored the settings and CLI pins.

  • accountFooterSuffix now resolves the effective pin as CLI > settings > stored, and picks block-aware: a blocked pin (a blockedUntil in the future on the stored slot) is skipped for the first usable slot in the same ranking, and the suffix marks the blocked pin, e.g. @work (default blocked until 14:00). When every slot is blocked it names the top-ranked slot with a blocked marker instead of silently naming a slot that cannot serve. An expired block is treated as usable; no pin still falls back to the session's HRW winner, skipping blocked winners.
  • FooterComponent takes an optional resolveAccountPin resolver; interactive mode wires it to resolveClaudeAccountPin(getSessionClaudeAccountPin(sessionId), <settings pinnedAccount>, undefined), so the stored pin stays the fallback inside the footer function. The Grok chrome footer has no account display, so there is nothing to wire there.

Tests

  • New regression packages/coding-agent/test/suite/regressions/issue-5983-footer-serving-account.test.ts (6 tests): blocked pin names the serving sibling with the marker; settings pin overrides the stored pin (including when the settings pin itself is blocked); a blocked HRW winner is skipped; all-blocked names the pin with a marker; an expired block is usable.
  • RED before the fix: 5 failed / 1 passed on the pre-fix footer.ts (the expired-block case passes trivially on old code, as it ignores blocks). GREEN after: 6 passed.
  • Neighbouring footer suites pass: footer-account-display, footer-account-label-coloring, footer-fast-mode-icon — 18 passed in total.
  • bun run check exits 0 (lint, fmt, ratchet, pinned-deps, ts-imports, conflict markers, entry graphs, locks, tsc, browser smoke).

Residuals

  • Real-CLI QA through senpi-qa was not run in this round (time-boxed wave); the change is footer rendering only, covered by the regression tests above.
  • Per-model blocks (modelBlocks) are not considered: the footer does not know the active model at the suffix boundary, so only account-level blockedUntil gates the pick.
  • The new CLA for code-yeongyu repos is pending the user's signature (known item, not this PR's scope).

Summary by cubic

Fixes the interactive footer so it names the account that will actually serve: a pinned account blocked by a usage limit is skipped for the serving sibling, and CLI/settings pins now outrank the stored pin.

  • A blocked pin falls back to the next usable slot and is marked (@work (default blocked until 14:00)); when every slot is blocked the top-ranked one is named with a blocked marker, and expired blocks count as usable.
  • FooterComponent takes an optional account-pin resolver that interactive mode wires to CLI > settings > stored pin resolution.
  • The Anthropic CLI/settings pin is applied only when the current model uses the anthropic-subscription provider; other pooled providers keep their own stored pin even when a slot shares the pin's name.
  • Adds a regression suite and changelog entry covering blocked-pin, settings-pin, all-blocked, expired-block, and provider-gating scenarios.

Written for commit ef63f05. Summary will update on new commits.

View guided diff

@code-yeongyu

Copy link
Copy Markdown
Owner

Thanks @surlymochan. Naming the serving account is the right fix for #5983, but one regression needs fixing first.

Needs a change: interactive-mode.ts:1326-1337 builds resolveAccountPin from the Anthropic CLI/settings pin without looking at the provider, and footer.ts:282-288 applies it on every render to whatever provider the current model uses (state.model.provider). For non-Anthropic pooled providers (openai-codex/gpt-account, Cursor), a slot that shares a name with the Anthropic pin (default, work) now gets named by the footer and overrides that provider's own stored pin, though its rotation never sees the Anthropic pin. The base read only the provider's own pinned. Resolving the pin only when state.model.provider is the Anthropic subscription provider (and keeping the stored pin otherwise) fixes it; a test with a same-named non-Anthropic slot would pin it.

Smaller (can follow):

  • footer.ts:93-99 always names "the first unblocked slot" as serving when the pin is blocked, but with accountFallback: false a blocked pin raises AllAccountsBlockedError and no sibling serves (anthropic-subscription/affinity.ts:166-240).
  • footer.ts:79-84 checks only the account-level blockedUntil; a model-family limit (failover.ts:240-246, modelBlocks) also moves turns to a sibling, and the footer still names the pin unmarked.
  • interactive-mode.ts:1334 reads the settings file synchronously on every footer render; caching it would keep disk I/O off the render path.
  • issue-5983-footer-serving-account.test.ts:30-33 computes the expected hh:mm with a copy of the production formatter, so a formatter bug would match on both sides; pinning a TZ or asserting a literal closes that.

…iption provider

The Anthropic CLI/settings pin leaked into non-Anthropic pooled
providers: a slot sharing the pin's name (e.g. openai-codex
"default") was named by the footer and overrode that provider's
own stored pin, though its rotation never sees the Anthropic pin.
Resolve the pin only when the current model uses
anthropic-subscription; otherwise the stored pin stands. Adds a
render-level regression test with a same-named non-Anthropic slot.
@surlymochan

Copy link
Copy Markdown
Contributor Author

Thanks for the review — fixed the blocking regression:

  • footer.ts now resolves the Anthropic CLI/settings pin only when the current model uses the anthropic-subscription provider; other pooled providers keep their own stored pin, so a same-named slot (e.g. openai-codex default) is no longer renamed or overridden.
  • Added a render-level regression test (issue-5983-footer-serving-account.test.ts): openai-codex with stored pin work + Anthropic pin default renders (openai-codex@work); the anthropic-subscription control still renders @default. It failed before the fix ((openai-codex@default)) and passes now.
  • Tests: 12 footer/regression files, 71 passed; bun run check clean.

The four smaller items are follow-ups, not in this change: accountFallback: false blocked-pin naming, model-family modelBlocks marking, settings-read caching, and the hh:mm test expectation. Happy to take them as follow-up PRs if you want.

@code-yeongyu

Copy link
Copy Markdown
Owner

Thanks @surlymochan, the blocking regression is fixed. Re-review at 05cfd7beb0: approve (LOW notes only).

Fine as follow-ups:

  • With accountFallback === false, the footer still skips a blocked pin (footer.ts:97-102), while the real selector throws AllAccountsBlockedError. So it shows @work (default blocked until …) with no account serving.
  • The footer only sees blocks stored in auth.json. Plain rate limits, per-model-family limits and modelBlocks stay in memory, so in those cases the footer can still name the pin.
  • With 3+ accounts the footer's sibling choice (rendezvousOrder + applyAccountOrder) can differ from the selector's real ordering in affinity.ts.
  • Each footer render reads and hashes the settings files synchronously (interactive-mode.ts:1334). Caching would help while streaming.
  • The CHANGELOG line slightly overclaims. "when the pin carries a stored block" would be accurate.

The branch was 289 commits behind main, so I merged main into it with no conflicts, as 9d0945d89d. Next: the full suite, then merge on green. I'll post the merge SHA here.

@code-yeongyu
code-yeongyu merged commit 724f252 into code-yeongyu:main Nov 10, 2026
11 checks passed
@code-yeongyu

Copy link
Copy Markdown
Owner

Merged as 724f252f28 into main. Thanks @surlymochan for sticking with this through two re-heads! The full suite was green at ef63f05e3e (15 rows, 0 failures) plus the macOS EQ row.

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.

Footer keeps naming the pinned Claude account after account fallback moved the session to another account

2 participants