Skip to content

fix(accounts): show Needs sign-in for a signed-out system Claude login - #45714

Open
innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix-20131-claude-system-sign-in
Open

innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix-20131-claude-system-sign-in

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Problem

With no managed Claude account selected, Settings → Accounts shows the System default row as an active login ("Use your current … Claude login") even when local usage has already classified that login as signed out.

The Codex section already shows a "Needs sign-in" badge and a destructive row for the same situation. The Claude row did not.

Change

The system-default Claude row now follows that local-only treatment.

  • The warning uses the status-bar sign-in classification: missing-credentials, or a credential error with no other failure kind (getUsageRosterRowState kind sign-in).
  • A saved account that is the active login, a usage poll for a different runtime, a poll that already has usage windows, and a poll that is still fetching do not warn.
  • Remote account scope passes no desktop usage snapshot, so that host does not inherit this machine's login state.
  • The row reuses the existing "Needs sign-in" string. The subtitle stays "Use your current … Claude login." and only takes the destructive color.
  • The row waits until the Claude account roster has loaded, matching the Codex gate.

This does not add a signed-out failure kind. The status bar classifies this state as above.

Tests

src/renderer/src/components/settings/accounts/claude/claude-account-auth-warning.test.ts

Before the function returned a warning, the missing-credentials case and the "Not logged in" case failed (expected missing-sign-in, received null). The other six cases passed.

After the change, all 8 tests passed:

node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/renderer/src/components/settings/accounts/claude/claude-account-auth-warning.test.ts

Limits

The desktop Accounts pane was not opened. The badge and destructive classes match the existing Codex system-default row. This does not change status-bar copy, and it does not name the system-default Claude login.

Fixes #20131

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The Claude Accounts pane now checks usage rate-limit data for a missing sign-in on the System default account. It limits this check to the matching runtime and waits for the Claude account snapshot to load. When the warning applies, the System default row displays a “Needs sign-in” badge and destructive styling.

Severity of issue fixed: Medium

Merge Risk: Low · up to b525d

The System default Claude row may show a misleading "Needs sign-in" badge in some WSL multi-distro setups. The effect is display-only and narrow, so the change is mergeable with a follow-up.

Pre-merge checks: Passed 2 · Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description follows the template well. It covers the problem, the change mechanism, the tests with the exact command and before/after results, and the limits. It lacks the ELI5 section, a user-fac… Add an ELI5 summary in plain language. Add a Visual Proof section with BEFORE and AFTER screenshots or a video of the System default Claude row, because this is a UI change. Complete the Testing checkboxes and state which platforms were tes…
Linked Issues check Inconclusive Issue #20131 asks that the System default Claude row show the existing "Needs sign-in" treatment (badge and destructive styling) when the local usage snapshot for the viewed runtime reports sign-out. … Confirm with the issue owner whether the missing-credentials or credential-error classification satisfies #20131 in place of the signed-out kind. If the signed-out kind is required, the PR must consume it from the usage snapshot once …
Passed Passed checks: 2 passed

Check name Status Explanation
Title check Passed The title names the main change: the system-default Claude row now shows "Needs sign-in" when the local Claude login is signed out. It uses the conventional fix(scope) prefix and is 70 characters, wit…
Out of Scope Changes check Passed All changed files relate to the System default Claude row warning. AccountsPane.tsx derives the warning and passes null limits for remote scope, mirroring the Codex gate. accounts-pane-types.ts ad…
Full details: Title check

Explanation

The title names the main change: the system-default Claude row now shows "Needs sign-in" when the local Claude login is signed out. It uses the conventional fix(scope) prefix and is 70 characters, within a normal length. It matches the PR objectives and the changed files (AccountsPane, the Claude section renderer, and the new auth warning helper).

Full details: Out of Scope Changes check

Explanation

All changed files relate to the System default Claude row warning. AccountsPane.tsx derives the warning and passes null limits for remote scope, mirroring the Codex gate. accounts-pane-types.ts adds systemClaudeNeedsSignIn. accounts-pane-claude-section.tsx renders the badge and destructive styling from that flag. claude-account-auth-warning.ts holds the classification helper. claude-account-auth-warning.test.ts covers that helper. No unrelated behavior or copy change is described. The PR states that status-bar copy is unchanged.

Full details: Description check

Explanation

The description follows the template well. It covers the problem, the change mechanism, the tests with the exact command and before/after results, and the limits. It lacks the ELI5 section, a user-facing before/after visual proof (the author states the pane was not opened), a linked issue in the required 'Fixes #' format (it reads 'Fixes #20131', which is filled), a Risk section with a level and rollback note, and the Notes/Checklist items. The Visual Proof section is required for UI changes and is not provided.

Resolution

Add an ELI5 summary in plain language. Add a Visual Proof section with BEFORE and AFTER screenshots or a video of the System default Claude row, because this is a UI change. Complete the Testing checkboxes and state which platforms were tested. Add a Risk section with a Level (Low, Medium, or High), the riskiest part, and how to revert. Complete the Review, Notes, and Checklist sections, or mark them as not applicable.

Full details: Linked Issues check

Explanation

Issue #20131 asks that the System default Claude row show the existing "Needs sign-in" treatment (badge and destructive styling) when the local usage snapshot for the viewed runtime reports sign-out. It names a signed-out failure kind from #20120 as the trigger and requires local-host scope only. The PR implements the row treatment. getClaudeSystemDefaultSignInWarning returns missing-sign-in when getUsageRosterRowState returns kind sign-in. It returns null for a remote scope (limits passed as null), a saved active account, a WSL or other runtime mismatch, and absent limits. The PR does not add a signed-out kind. The reviewed head file claude-account-auth-warning.ts shows no signed-out handling. The trigger therefore differs from the issue's stated signal. The missing-credentials state is the state the issue describes, so the behavior likely matches the bug report. The signed-out kind is not confirmed as present or absent at the reviewed head. The desktop Accounts pane was not exercised, and the rendering in accounts-pane-claude-section.tsx was taken from the summary. Unit test results (8 of 8 passing) are reported by the author and were not re-run.

Resolution

Confirm with the issue owner whether the missing-credentials or credential-error classification satisfies #20131 in place of the signed-out kind. If the signed-out kind is required, the PR must consume it from the usage snapshot once #20120 lands. Alternatively, update #20131 to cite the status-bar sign-in classification. Optionally, confirm at the reviewed head that the AccountsPane row renders the badge and destructive classes for the system-default Claude row.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c8064e1a-e7d8-4ffc-8920-af5aaee05130
Commits

Reviewing files that changed from the base of the PR and between 961ee09 and b525db8.

Files selected for processing: 5

  • src/renderer/src/components/settings/accounts/AccountsPane.tsx
  • src/renderer/src/components/settings/accounts/accounts-pane-types.ts
  • src/renderer/src/components/settings/accounts/claude/accounts-pane-claude-section.tsx
  • src/renderer/src/components/settings/accounts/claude/claude-account-auth-warning.test.ts
  • src/renderer/src/components/settings/accounts/claude/claude-account-auth-warning.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

if (runtime.runtime === 'host') {
return true
}
return !runtime.wslDistro || target.wslDistro === runtime.wslDistro

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.

Minor · Functional Correctness · Quick win

Match the concrete WSL default distro.

When runtime.wslDistro is null, this accepts every WSL poll target. If Debian is the WSL default and the poll targets signed-out Ubuntu, the Debian System default row incorrectly shows “Needs sign-in”.

Resolve the default distro before comparing targets. Preserve matches when an explicit target names that same default distro.

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.

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

1 participant