Skip to content

feat(status-bar): add re-authenticate action to Claude usage menu - #6828

Closed
mantaroh wants to merge 2 commits into
stablyai:mainfrom
mantaroh:feat/status-bar-claude-reauth
Closed

mantaroh wants to merge 2 commits into
stablyai:mainfrom
mantaroh:feat/status-bar-claude-reauth

Conversation

@mantaroh

@mantaroh mantaroh commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Claude CLI authentication lapses overnight, so after Orca sits idle the
bottom-left usage status bar can no longer report Claude usage until the
account is re-authenticated. This adds a one-click "Re-authenticate" entry to
the Claude account menu in the usage status bar, refreshing the active managed
account in place without opening Settings → Accounts.

  • Calls the existing claudeAccounts.reauthenticate flow, then reloads
    accounts, settings, and usage for the active runtime target.
  • Renders only when an active managed account exists; system-default sessions
    are unaffected and keep using Settings.
  • Localized in en/ja/zh/ko/es via the existing i18n key tooling.

Screenshots

(Attached to the PR conversation: the open Claude menu showing the new
"Re-authenticate" entry above "Manage Accounts…".)

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test — 20522 passed. 2 failures are pre-existing and environmental
    on the dev machine, unrelated to this change and in files this PR does not
    touch: one expects English weekday labels but the machine locale is
    ja_JP (passes under LANG=C); one expects 0o600 credential-store perms
    but the local filesystem reports 0o644.
  • pnpm build
  • Added e2e test (tests/e2e/claude-status-reauth-button.spec.ts) seeding an
    active managed account and asserting the menu entry renders.

AI Review Report

Reviewed for cross-platform, remote/SSH, provider neutrality, performance, UI,
and security:

  • Cross-platform (macOS/Linux/Windows): no platform-specific code; no shortcuts,
    path handling, or shell calls added. Reuses existing DropdownMenu primitives
    and the runtime-target plumbing already used by the Codex menu. Label is i18n,
    not hardcoded.
  • Remote/SSH: re-auth uses the existing runtime-target-aware reauthenticate and
    refreshClaudeRateLimitsForTarget(runtimeTarget), so host/WSL/remote selection
    is preserved; no local-only assumptions.
  • Provider neutrality: scoped to Claude managed accounts; mirrors existing Codex
    menu behavior; no other providers touched.
  • Performance: one conditional menu item plus a guarded async handler; no
    hot-path work, no new polling.
  • UI: follows STYLEGUIDE tokens/shadcn primitives; RefreshCw/Loader2 icons match
    the Codex sign-in entry; spinner shown during the in-flight login; menu kept
    open during the call so progress is visible.
  • Security: no new IPC surface — reuses claudeAccounts:reauthenticate; no
    secrets logged; the only argument is the active account id from app state.

Flagged/changed: the entry is gated on an active managed account, since
system-default has no account id to pass to the IPC.

Security Audit

  • Input handling: only an internal account id (from store state) reaches the
    existing reauthenticate IPC; no user-entered strings.
  • Command execution / path handling: none added; the CLI login is the existing
    main-process flow.
  • Auth/secrets: no credentials read or logged in the renderer; OAuth capture
    stays in the existing main-process service.
  • IPC: no new channels.
  • Dependencies: none added.

Follow-up: none.

Notes

  • Managed accounts only (no system-default re-auth) — by design, matches the IPC
    contract.
  • Screenshots attached to the PR conversation, not committed (repo policy).

ELI5

Claude usage in the status bar can go stale overnight when auth expires. A one-click “Re-authenticate” item on the Claude account menu refreshes the active account without opening Settings.

Claude CLI auth lapses overnight, leaving the bottom-left usage status bar
unable to report Claude usage until the user re-authenticates. Add a
"Re-authenticate" entry to the Claude account menu that refreshes the active
managed account in place, without a trip to Settings. The entry shows only
when an active managed account exists; system-default sessions keep falling
back to Settings.

Add an e2e test that seeds an active managed account and asserts the new menu
entry renders.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A “Re-authenticate” action is added to the Claude status bar account switcher. The dropdown now shows the action for the active account, disables it during switching or reauthentication, and shows a loading spinner while the reauthentication request is in progress. A new handler calls window.api.claudeAccounts.reauthenticate, updates account state, refreshes settings, and refreshes Claude rate limits. English, Spanish, Japanese, Korean, and Chinese locale entries are added, and an end-to-end test verifies the menu item is visible.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main user-visible change in the status bar Claude menu.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description matches the required template and includes summary, screenshots, testing, AI review, security audit, and notes with cross-platform confirmation.

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: Pro

Run ID: e2b6bb46-6727-4fbd-b979-322b8ab06d26

📥 Commits

Reviewing files that changed from the base of the PR and between 499b900 and fafda20.

📒 Files selected for processing (7)
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • tests/e2e/claude-status-reauth-button.spec.ts

@mantaroh

mantaroh commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor Author

A bit of context on why I put this together: I do most of my development on an SSH remote, and the local Claude Code authentication tends to lapse while the machine sits idle (e.g. overnight).
Once it does, the usage status bar can't report anything until I re-authenticate, and going into Settings → Accounts each time was a small but recurring friction. This adds a quick "Re-authenticate" entry directly to the status bar menu.

Apologies for opening this as a direct PR without filing an issue first — I probably should have raised an issue to check whether this is a direction you'd want before implementing. If you'd prefer, I'm happy to close this and start with an issue to discuss the approach, or to adjust it based on your feedback.

For reference, here's the menu running locally:
claude-reauth-button-full

(Sorry for Japanese screenshot 🙏🏼 再認証 mean Re-Authenticate )

The accessible-name assertions previously matched only English and Japanese,
so the test could fail under other locales even when the menu rendered. Seed
uiLanguage='en' so I18nProvider pins the UI language, and assert against the
English labels deterministically regardless of host/CI locale.
@mantaroh

mantaroh commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@brennanb2025

I noticed that a root cause fix has already been proposed in #6864.Since my PR (#6828) addresses a similar issue/consequence, please let me know how you'd like to handle this.If #6864 is preferred, I'm happy to close this PR. Otherwise, let me know if this can be reviewed as a temporary workaround. Thanks!

@nwparker

Copy link
Copy Markdown
Contributor

Thanks @mantaroh for the work here. Closing as superseded: the account switcher now offers an inline Sign in action for accounts that need re-authentication, and the underlying credential issue was reworked in #26801. Appreciate the contribution, and feel free to open a fresh PR against current main if you see anything still missing.

@nwparker nwparker closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants