Skip to content

fix(accounts): flag signed-out system-default Claude login in Accounts pane - #20134

Closed
mmarabel wants to merge 8 commits into
stablyai:mainfrom
mmarabel:fix/claude-accounts-signed-out-row
Closed

mmarabel wants to merge 8 commits into
stablyai:mainfrom
mmarabel:fix/claude-accounts-signed-out-row

Conversation

@mmarabel

Copy link
Copy Markdown
Contributor

ELI5

The status-bar fix shows "not signed in" when Claude's stored login is emptied — but Settings → Accounts still showed the System default row as a healthy active login. This makes the Accounts pane agree with the meter, using the same warning pattern Codex already has.

What Changed

  • New src/renderer/src/components/settings/claude-account-auth-warning.ts — getClaudeSystemDefaultSignInWarning, mirroring getCodexAccountAuthWarning: true only when the system-default login is the active selection, the usage snapshot target matches the viewed runtime, and the snapshot reports the signed-out failure kind.
  • AccountsPane.tsx derives systemClaudeNeedsSignIn from the local snapshot (limits: isRemoteAccountScope ? null : claudeRateLimits, so remote owners never inherit the desktop reading) and passes it into the section model.
  • accounts-pane-claude-section.tsx: the System default row gets the Codex treatment — destructive border plus the existing "Needs sign-in" badge (AccountsPane.93c47b333a, reused, no new strings).
  • Stacked on fix(status-bar): surface signed-out Claude usage instead of hiding the segment #20120, which introduces the signed-out snapshot this consumes (branch contains its commits until it merges; diff narrows automatically).

Why

Two components had two definitions of "logged in": the usage fetcher verified tokens while the Accounts pane asserted the environment login works without checking. Users saw "Active" in Settings and a dead meter with no path between them. Now both surfaces agree.

Linked Issue

Fixes #20131. Depends on #20120 — merge that first; this diff then narrows to the Accounts-pane commits.

Visual Proof

No screenshots: headless Linux worktree, affected surface is desktop Settings. Verified via unit tests (warning derivation incl. target-mismatch and remote-scope suppression) and the shared-badge render path already exercised by the Codex section. Happy to attach macOS shots on request.

Testing

  • I manually tested these changes locally (headless worktree — see above)
  • Automated tests added (claude-account-auth-warning.test.ts: signed-out→warn, managed-selection/other-kinds/non-error→quiet, target mismatch→quiet, remote scope handled by null limits at the call site)
  • Platforms: Linux unit/typecheck. Change is renderer-only, platform-agnostic, no new strings/locales, no new host assumptions (remote scope explicitly suppressed).

AI Disclosure

Implemented with Muse Spark via the Pi coding agent under the author's direction.

Review

Self-review (AI agent): mirrors the existing Codex warning path field-for-field (same badge key, same border classes, same remote-scope nulling); snapshot→row attribution guarded by target matching; no secrets touched (reads only status/failureKind); no perf impact (one store selector + boolean derivation on render).

Agent skill upstream boundary

  • Not applicable — no skill sources copied or translated.

Notes

Security, cross-platform, remote SSH (explicitly suppressed for remote owners per #7973), backwards compatibility, performance considered above. Mobile untouched.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason (see Visual Proof)
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint (changed-code quality gate: 0 findings), pnpm typecheck, pnpm test pass locally (pnpm build covered on the base branch; renderer-only delta)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — a couple of minor suggestions inline.

Reviewed changes

  • signed-out snapshot — the desktop rate-limit fetch now classifies a stored-but-empty Claude credential entry as a terminal signed-out failure (no CLI/PTY/delegated-refresh fallback), and the status bar surfaces it as "not signed in" instead of hiding the segment.
  • Accounts pane agreement — a new getClaudeSystemDefaultSignInWarning mirrors the Codex warning: the System-default Claude row gets a destructive border and the existing "Needs sign-in" badge when the viewed runtime's snapshot reports signed-out and the system default is the active selection, with remote owners suppressed (limits: null).
  • Tests — new unit tests pin the classification, the fetch short-circuit, status-bar copy, and the warning derivation, including target-mismatch and remote-scope suppression.

Note: this diff includes the two stacked #20120 commits (signed-out detection + status-bar surfacing) ahead of the Accounts-pane commit; the Accounts-pane work itself is small and well-constructed.

ℹ️ Nitpicks

  • claudeRateLimitTargetMatchesAccountRuntime (and the AccountRuntime type) in claude-account-auth-warning.ts are byte-for-byte identical to codexRateLimitTargetMatchesAccountRuntime in codex-account-auth-warning.ts. Extracting a shared target-matcher would keep the two from drifting.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 3150705d-a5d5-4a23-8ddc-db20ba8896e1

📥 Commits

Reviewing files that changed from the base of the PR and between 609fe6b and 35dba09.

📒 Files selected for processing (10)
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/accounts-pane-account-actions.ts
  • src/renderer/src/components/settings/accounts-pane-claude-section.tsx
  • src/renderer/src/components/settings/accounts-pane-types.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/ui/badge.test.tsx
  • src/renderer/src/components/ui/badge.tsx
  • src/shared/rate-limit-types.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b4ec2340-d974-49cf-9873-035f53f46af2

📥 Commits

Reviewing files that changed from the base of the PR and between 279885cbe909c248f89d424ab2275be4d3e428c5 and 609fe6b.

📒 Files selected for processing (2)
  • src/renderer/src/components/settings/accounts-pane-claude-section.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change adds a signed-out rate-limit failure kind for stored Claude credentials with empty tokens. Credential loading preserves this state, classification makes it terminal, and usage fetching avoids refresh and PTY fallback attempts. The Accounts pane shows a needs-sign-in state for matching local Claude usage. The status bar keeps signed-out Claude providers visible and displays sign-in-specific labels and actions. Tests cover credential sources, classification, settings warnings, and status-bar behavior.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 609fe

The Accounts pane and status bar present the signed-out state consistently without an identified merge-blocking regression.

🚥 Pre-merge checks | ✅ 4 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change, reason, linked issues, testing, scope, and review notes. It does not provide the required before-and-after visual proof for this UI change. Attach before-and-after screenshots or a video for the Accounts pane. Do not use N/A because the change affects visible UI behavior.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 17 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive The summary includes credential-classification changes associated with dependency #20120 in addition to the Accounts pane changes. The description explains that these commits are stacked and should na… Confirm that #20120 is included in the target branch before merging, or remove the dependency commits from this pull request.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The description links issue #20131 with Fixes #20131 and identifies dependency #20120.
Title check ✅ Passed The title clearly and concisely describes the primary change: flagging a signed-out system-default Claude login in the Accounts pane.
Linked Issues check ✅ Passed Issue #20131 requires the Claude System default row to show the existing “Needs sign-in” treatment when the viewed local runtime reports a signed-out usage failure. The change derives this state onl…
Out of Scope Changes check ✅ Passed The credential classification, signed-out failure type, usage-state handling, status-bar handling, and related tests support the sign-in state required by issue #20131. The Accounts pane integration…
Full details: Out of Scope Changes check

Explanation

The summary includes credential-classification changes associated with dependency #20120 in addition to the Accounts pane changes. The description explains that these commits are stacked and should narrow after the dependency merges.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c015f6b1-9a18-49a3-ab39-a2e4aceb9596

📥 Commits

Reviewing files that changed from the base of the PR and between 9a56797 and 01ec9eec4694765eaf32e29263e6348d9cf9feb7.

📒 Files selected for processing (16)
  • src/main/rate-limits/claude-active-usage-fetch.ts
  • src/main/rate-limits/claude-fetcher-keychain-credentials.test.ts
  • src/main/rate-limits/claude-oauth-credentials.ts
  • src/main/rate-limits/claude-usage-error-classification.test.ts
  • src/main/rate-limits/claude-usage-error-classification.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/accounts-pane-claude-section.tsx
  • src/renderer/src/components/settings/accounts-pane-types.ts
  • src/renderer/src/components/settings/claude-account-auth-warning.test.ts
  • src/renderer/src/components/settings/claude-account-auth-warning.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-roster-row-state.test.ts
  • src/renderer/src/components/status-bar/usage-roster-row-state.ts
  • src/shared/rate-limit-types.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this incremental delta.

Reviewed changes

  • Loaded-roster gate — systemClaudeNeedsSignIn is now gated on a new claudeAccountsLoaded flag so the System-default row can't flash a stale signed-out warning before the viewed runtime's snapshot arrives; the flag resets on runtime switch and mirrors the existing Codex codexAccountsLoaded pattern.
  • Action-runner wiring — syncClaudeAccounts marks the roster loaded after account mutations, keeping the gate open for post-action state.

The two prior Pullfrog nitpick threads (duplicate Active + Needs sign-in badges; signed-out missing from getProviderUsageErrorMessage) remain open and unchanged by this commit.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@mmarabel
mmarabel force-pushed the fix/claude-accounts-signed-out-row branch from 279885c to 609fe6b Compare September 11, 2026 19:05

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Active badge suppression — the System-default Claude row now hides the Active badge (systemClaudeActive && !systemClaudeNeedsSignIn) and switches the subtext to text-destructive whenever the sign-in warning shows, so the row reads broken rather than both selected-healthy and broken.
  • signed-out tooltip message — getProviderUsageErrorMessage now returns the pattern-safe main-process message verbatim for signed-out (with a documented rationale and a test), resolving the prior nitpick about the raw 'Claude sign-in expired' string leaking into the tooltip.

Both prior Pullfrog nitpick threads are now addressed; the two changes are small, coherent, and each is pinned by a unit test.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor regression from the merge, inline.

Reviewed changes

  • Merged upstream/main into the branch — the only commit since the last review is the merge f197ee561f; it pulls in a large upstream set (OpenCode Go / MiniMax API-key work, the hostContext badge variant, the no-subscription failure kind) without disturbing this PR's own logic.
  • PR logic survives the merge — signed-out classification, the CLI/PTY short-circuit, the roster-loaded gate, and the status-bar copy all still line up with the upstream versions of the shared files they touch; the PR's unit tests pass on the merged tree.
  • Badge styling dropped in merge resolution — the System-default Claude Needs sign-in badge is the one PR-owned line the merge changed, and it no longer matches the Codex badge it is meant to mirror (inline below).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

The upstream merge dropped the square chip classes from the Needs sign-in badge because the design-system gate rejects restyling Badge through className. Add a compact size to the Badge primitive and use it, so the badge again matches the Codex mirror without a restyle.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

The only commit since the prior pullfrog review is 35dba09e14, which cleans up the merge artifact flagged earlier and leaves the rest of the PR untouched.

  • Compact sign-in badge restored — the System-default Claude Needs sign-in chip is back to the square 16px geometry, matching the Codex mirror and the sibling Active badge. The author fixed it by generalizing the primitive rather than pasting the Codex class string.
  • New size axis on Badge — badgeVariants gains size (default: '', compact: 'h-4 rounded px-1.5 text-[10px] leading-none'), threaded through badgeVariants({ variant, size }). Because the output runs through cn (tailwind-merge), the compact classes correctly override the base rounded-full px-2 text-xs; default callers are unaffected.
  • Badge unit tests added — badge.test.tsx pins both the default pill geometry and the compact chip (and that compact drops rounded-full/px-2/text-xs), so the fix can't silently regress again.

Verified locally: pnpm test src/renderer/src/components/ui/badge.test.tsx passes (2/2) and pnpm run check:code-quality:changed origin/main reports 0 findings across all 19 changed files (design-system scan included). The prior inline thread on the badge is addressed and resolved.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker

Copy link
Copy Markdown
Contributor

Closing #20134 as stale after claude-active-usage-fetch.ts was refactored on main (this branch depends on #20120's retired signed-out failure kind and conflicts across 19 files). Keeping #20131 open so Accounts-pane parity can be revisited cleanly once the status-bar credential-warning path settles. Thanks @mmarabel!

@nwparker nwparker closed this Nov 11, 2026
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.

[Bug]: Accounts pane System default Claude row claims a working login when usage already reports signed-out

2 participants