Repository navigation
Conversation
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Warning Review limit reachedNext included review available in 16 seconds. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds a Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/rate-limits/claude-fetcher-keychain-credentials.test.ts (1)
473-473: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the default PTY fallback policy.
Both tests set
allowPtyFallback: false. With the default policy,fetchActiveClaudeRateLimitsreaches the CLI plan fallback after classifying an empty entry assigned-out, andfetchClaudeUsageViaClicallsfetchViaPty. Add a host-system test without this option. Assertsigned-outand nofetchViaPtycall.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f8da5a95-6731-48e5-9c6a-797c53f3a715
📒 Files selected for processing (11)
src/main/rate-limits/claude-active-usage-fetch.tssrc/main/rate-limits/claude-fetcher-keychain-credentials.test.tssrc/main/rate-limits/claude-oauth-credentials.tssrc/main/rate-limits/claude-usage-error-classification.test.tssrc/main/rate-limits/claude-usage-error-classification.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/usage-error-copy.test.tssrc/renderer/src/components/status-bar/usage-error-copy.tssrc/renderer/src/components/status-bar/usage-roster-row-state.test.tssrc/renderer/src/components/status-bar/usage-roster-row-state.tssrc/shared/rate-limit-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Emptied credential entries are now distinguishable —
parseClaudeOAuthCredentialsJsonsets an optionalhasEmptyStoredEntrywhen aclaudeAiOauthentry parses but holds no usable tokens, andreadClaudeOAuthCredentialspreserves that flag through the keychain/file precedence chain instead of collapsing it intomissing-credentials. - New terminal
signed-outfailure kind —classifyClaudeCredentialAbsencemapshasEmptyStoredEntryto a terminalsigned-outclassification, and the kind is added toUsageRateLimitFailureKind. - Fetch surfaces
errorinstead of hiding —fetchActiveClaudeRateLimitsreturns anerrorsnapshot (Claude sign-in expired) forsigned-out, which keeps the segment rendered by the existingerror-stays-visible convention. - Renderer copy and CTA — the Claude status label resolves to "not signed in" and
isConfirmedSignedOutearns the sign-in roster row.
The change is provider-scoped, additive (hasEmptyStoredEntry is optional and only consumed by Claude), and the new tests exercise the real darwin keychain path via setPlatform('darwin') with exact assertions (not tautological).
ℹ️ The signed-out affordance only surfaces for system-default accounts
The signed-out branch in fetchActiveClaudeRateLimits sits after the CLI fallback, so it is only reached when allowPtyFallback is false — i.e. system-default Claude (shouldAllowClaudePtyFallback → !isSystemDefaultClaudeAuth) or Windows. For a managed (non-system-default) account allowPtyFallback is true, so a signed-out CLI probe resolves to cli-unavailable before the signed-out check runs, leaving those accounts on their prior behavior. That matches the PR's stated scope (managed re-auth is #6828), but is worth carrying forward as a known boundary if signed-out is ever expected to cover managed accounts too.
Technical details
# Scope boundary: managed-account signed-out masking
## Affected sites
- src/main/rate-limits/claude-active-usage-fetch.ts:227 — CLI fallback runs for managed accounts before the signed-out check at :243
- src/main/rate-limits/service/service-fetch-targets.ts:133 — shouldAllowClaudePtyFallback returns false only for system-default (or Windows)
## Required outcome
- None for this PR. If managed-account signed-out should eventually surface "not signed in", the signed-out check would need to run before (or bypass) the CLI probe for managed accounts, or #6828 will handle it.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the single new commit since the prior Pullfrog review — it moves the signed-out terminal check ahead of the CLI fallback and trims blank access tokens.
signed-outnow returns before the CLI fallback — the check moved from just before the finalunavailablereturn to immediately afterclassifyClaudeCredentialAbsence, so an emptied credential store short-circuits before any refresh, live-session deferral, or PTY probe. Sincesigned-outis a terminal classification (shouldAttemptCliFallback: false), this also resolves the prior boundary note: managed accounts now surface "not signed in" instead of falling through to acli-unavailablePTY result.- Blank access tokens are trimmed to null —
parseClaudeOAuthCredentialsJsontreats whitespace-only access tokens as absent, so an entry holdingaccessToken: ""counts as emptied (hasEmptyStoredEntry) rather than reaching the OAuth path with a garbage token. Valid tokens are returned trimmed. - Test tightened to the new contract — the keychain test drops the
allowPtyFallback: falseoverride and assertsfetchViaPtyis never called even with PTY fallback allowed, matching the moved early return.
The move is safe with respect to live-session deferral: classifyClaudeCredentialAbsence checks managedRefreshDeferredByLivePty first, so a live session still classifies as deferred-by-live-session (not signed-out). hasEmptyStoredEntry only survives the keychain/file precedence chain when every source holds no usable token, so there is nothing for the CLI fallback to recover. Verified: 64 tests across the five changed test files pass.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the single new commit since the prior Pullfrog review — it makes the signed-out error message explicit in the renderer rather than relying on switch fall-through.
signed-outmessage surfaced verbatim via an explicit case —getProviderUsageErrorMessagenow returnsp.errorforsigned-outbefore themissing-credentialsfallthrough, with a comment documenting that the main-process'Claude sign-in expired'string is pattern-safe.
The change is behaviorally neutral: previously signed-out fell through the Claude switch and was returned verbatim by the trailing return p.error ('Claude sign-in expired' matches neither isUsageRateLimitError nor isUsageAuthError), so users saw the same message either way. Making it explicit is a sound robustness improvement — it decouples the renderer's signed-out copy from the auth-pattern block, so a future change to the main-process string cannot silently get rewritten into the generic auth copy.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
58326fb to
04be21b
Compare
…onflicts # Conflicts: # src/renderer/src/components/status-bar/usage-error-copy.test.ts
|
This branch is stale against current main. The problem is tracked again in #48455. Closing. |

ELI5
When your Claude sign-in quietly expires, Orca's status bar used to just delete the Claude usage meter with no explanation. Now it keeps the meter and says "not signed in", with the usual sign-in button in the usage popover.
What Changed
src/main/rate-limits/claude-oauth-credentials.ts: credential reads now reporthasEmptyStoredEntrywhen the Keychain item / credentials file parses but holds no usable tokens (previously this collapsed into "no credentials at all").src/main/rate-limits/claude-usage-error-classification.ts: that state classifies as a new terminalsigned-outfailure kind.src/main/rate-limits/claude-active-usage-fetch.ts: the no-credentials fallback returns statuserror(Claude sign-in expired) forsigned-outinstead ofunavailable, so existing visibility logic keeps the segment rendered. Truly-never-configured setups still returnunavailableand stay hidden.src/shared/rate-limit-types.ts: added'signed-out'toUsageRateLimitFailureKind.src/renderer/src/components/status-bar/usage-error-copy.ts: signed-out Claude labels as "not signed in" (reuses the existing roster key, no new strings).src/renderer/src/components/status-bar/usage-roster-row-state.ts:signed-outearns the sign-in CTA row, which opens Settings → Accounts.Why
unavailableis the one snapshot status that hides a status-bar segment entirely (by design, for never-configured providers). An emptied credential store was misreported asunavailable/missing-credentials, so users with a checked "Claude Usage" toggle and a seemingly-connected account got a silently vanishing meter and no path to recovery.errorsnapshots stay visible by design (same convention as Grok's "sign-in expired"), so mapping signed-out toerrorrestores the affordance with minimal new machinery.Linked Issue
Fixes #20118
Does not fix the related refresh-loop reports. #20251 and #21935 describe a different mechanism (the live-PTY OAuth refresh gate never reopening, so a managed token is never refreshed while a Claude pane stays alive), and #14833 covers the absent last-known values that make the failure render as nothing at all. This PR only makes the signed-out state visible instead of silently removing the segment; all three stay open after it merges.
Visual Proof
No screenshots attached: this was developed in a headless Linux worktree and the affected surface is the desktop status bar. Verified instead via unit tests covering the full chain (empty-store fetch result → visibility gate → segment label → roster sign-in row) plus the live
unavailablesnapshot captured while diagnosing #20118. Happy to attach macOS before/after shots on request.Testing
rateLimits.claude:unavailable/missing-credentials/credentialSource: 'none'with an existing-but-empty Keychain entry), then added regression tests:error/signed-outwith no network or PTY callsauthProvenance; no new host assumptions. Complements (does not touch) open feat(status-bar): add re-authenticate action to Claude usage menu #6828, which covers re-auth for managed accounts — this covers system-default.AI Disclosure
Implemented with Muse Spark via the Pi coding agent under the author's direction; diagnosis verified against live app state on the author's Mac.
Review
Self-review (AI agent): cross-platform safe (no new OS branches, paths, or shortcuts); SSH/remote safe (provenance preserved, generic message with no host-specific command); provider-scoped to Claude (other providers'
failureKindswitches have fallthrough defaults; service policies only special-caserate-limited); no perf impact (parse-time boolean, and the error streak feeds the existing poll backoff); no security impact (no secrets read differently or logged — the existing warn log already emits only booleans/source names).Agent skill upstream boundary
Notes
Rebased onto
main@33ba1ff3df(2026-09-21) after the branch fell 1170 commits behind; replayed with no conflicts and the diff is unchanged at 11 files, +177/-9. Re-verified on the rebased branch:pnpm tcclean, 880 tests acrosssrc/main/rate-limitsandsrc/renderer/src/components/status-barpass, and the changed-code quality gate reports 0 findings across the 11 changed files (run against the real base — with no argument it resolves to a staleorigin/mainand reports unrelatedmobile/findings).Security, cross-platform (Linux/Windows/Mac), remote SSH, backwards compatibility, and performance considered above; mobile untouched (shared union addition only, no mobile consumers of the new kind).
Checklist
N/Awith reason (see Visual Proof)pnpm lint(changed-code quality gate: 0 findings),pnpm typecheck,pnpm test, andpnpm buildpass locally