Repository navigation
Improve Claude usage refresh fallback behavior - #5995
Conversation
Co-authored-by: Orca <[email protected]>
|
Ready to review this PR? Stage has broken it down into 7 individual chapters for you: Chapters generated by Stage for commit 1048558 on Jun 21, 2026 7:58pm UTC. |
Co-authored-by: Orca <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR restructures Claude usage limit tracking in Orca to introduce classification-driven OAuth/CLI fallback behavior with comprehensive metadata tracking. It adds shared 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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: 1
🧹 Nitpick comments (3)
docs/claude-usage-tracking-codexbar-parity.md (1)
26-39: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winReplace the machine-specific CodexBar paths.
These
/Users/...references are brittle and leak a local username. Use repo-relative paths or stable permalinks so the spec works for everyone.♻️ Example rewrite
- Reference: `/Users/jinwoohong/stably/codexbar/Sources/CodexBarCore/Providers/Claude/ClaudeSourcePlanner.swift:173` + Reference: `Sources/CodexBarCore/Providers/Claude/ClaudeSourcePlanner.swift:173`src/main/rate-limits/claude-usage-refresh-plan.ts (1)
36-39: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd a short “why” note for the deferred web fallback decision.
webDeferred: trueencodes a non-obvious parity constraint; please annotate the reason inline so this doesn’t get “simplified” later.As per coding guidelines, code driven by non-obvious constraints should include a short comment explaining why it behaves that way.Suggested tweak
return { steps, + // Why: first parity pass intentionally keeps web fallback disabled. webDeferred: true }Source: Coding guidelines
src/main/rate-limits/claude-fetcher.test.ts (1)
637-655: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd the complementary keychain-unavailable test with CLI fallback enabled.
This suite currently validates only the disabled-fallback path. Adding an
allowPtyFallback: truecase would pin the intended recovery behavior and prevent regressions in the credential-classification branching.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1346147b-3788-4e3c-be06-3dda14b17625
📒 Files selected for processing (13)
docs/claude-usage-tracking-codexbar-parity.mdsrc/main/rate-limits/claude-fetcher.test.tssrc/main/rate-limits/claude-fetcher.tssrc/main/rate-limits/claude-usage-error-classification.test.tssrc/main/rate-limits/claude-usage-error-classification.tssrc/main/rate-limits/claude-usage-refresh-plan.test.tssrc/main/rate-limits/claude-usage-refresh-plan.tssrc/main/rate-limits/service.test.tssrc/main/rate-limits/service.tssrc/renderer/src/components/status-bar/tooltip.test.tssrc/renderer/src/components/status-bar/tooltip.tsxsrc/renderer/src/components/status-bar/usage-error-copy.tssrc/shared/rate-limit-types.ts
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
* Match CodexBar Claude usage fallback behavior Co-authored-by: Orca <[email protected]> * Remove external tracker references from Claude usage changes Co-authored-by: Orca <[email protected]> * Allow CLI fallback when Claude Keychain is unavailable Co-authored-by: Orca <[email protected]> * Stabilize updater prerelease promotion test Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]> (cherry picked from commit 530f98d)
* Match CodexBar Claude usage fallback behavior Co-authored-by: Orca <[email protected]> * Remove external tracker references from Claude usage changes Co-authored-by: Orca <[email protected]> * Allow CLI fallback when Claude Keychain is unavailable Co-authored-by: Orca <[email protected]> * Stabilize updater prerelease promotion test Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Summary
Review
Verification
pnpm exec vitest run --config config/vitest.config.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/claude-usage-error-classification.test.ts src/main/rate-limits/claude-usage-refresh-plan.test.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/tooltip.test.tspnpm run typecheckpnpm exec oxlint src/main/rate-limits/claude-fetcher.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/claude-usage-error-classification.ts src/main/rate-limits/claude-usage-error-classification.test.ts src/main/rate-limits/claude-usage-refresh-plan.ts src/main/rate-limits/claude-usage-refresh-plan.test.ts src/main/rate-limits/service.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/tooltip.tsx src/renderer/src/components/status-bar/usage-error-copy.ts src/renderer/src/components/status-bar/tooltip.test.ts src/shared/rate-limit-types.tspnpm exec oxfmt --check src/main/rate-limits/claude-fetcher.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/claude-usage-error-classification.ts src/main/rate-limits/claude-usage-error-classification.test.ts src/main/rate-limits/claude-usage-refresh-plan.ts src/main/rate-limits/claude-usage-refresh-plan.test.ts src/main/rate-limits/service.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/tooltip.tsx src/renderer/src/components/status-bar/usage-error-copy.ts src/renderer/src/components/status-bar/tooltip.test.ts src/shared/rate-limit-types.tsNote: local shell reports the repo's standard Node engine warning because it is using Node v26 while the repo expects Node 24; commands above passed.