stablyai / stablyai/orca

[Bug]: (Does not affect normal use) Claude Code usage status stuck on "Refreshing sign-in" and does not update

Open
#8,974 4 comments 1 reaction 1 assignee Claimed by @OrcaWin View on GitHub
bug has_repro os:macos untriaged
Dominant language
TypeScript
Stars
72.1k
Forks
4.7k
Avg merge
14h 54m
Merged PRs (30d)
520

Description

## Summary

Claude Code (CC) itself still works in the terminal, but Orca’s **Claude usage / status-bar tracking sometimes fails to refresh**. The status UI gets stuck on **“Refreshing sign-in”** and never recovers to live usage numbers.

Reporter confirmation: CC is usable in-terminal; the problem is specifically that **usage status cannot refresh**.

## Environment

- **Orca version:** 1.4.137
- **OS:** macOS 15.7.7
- **Hardware:** Apple M2 Pro
- **Claude Code version:** 2.1.208

## What happened

1. Claude usage / rate-limit status does not update in Orca.
2. Opening the Claude account / status UI shows a persistent **Refreshing sign-in** state:
- Status label: `Refreshing sign-in`
- Message: `Claude sign-in is being refreshed. Agent sessions may still be signed in.`
- Account selector shows `Claude Account` → `System default`
3. Claude Code sessions in the terminal continue to work (agent is signed in and usable).
4. Status remains stuck in this state rather than completing the refresh and showing usage percentages.

## Expected behavior

- Claude usage status refreshes successfully (auto or manual).
- Status bar / account UI shows current usage after refresh.
- Transient credential refresh should not leave the UI stuck indefinitely while agent sessions remain signed in and working.

## Actual behavior

- Usage tracking does not update.
- UI remains stuck on **Refreshing sign-in**.
- Terminal Claude Code continues to work, so this looks like a **usage-fetch / sign-in-refresh orchestration** problem rather than a full logout.

## Screenshots

(Attached in follow-up comments if not inline.)

The stuck state shows:
- Claude popover: **Refreshing sign-in**
- Footer/status chip: **⚠ Refreshing sign-in**
- Message about agent sessions still being signed in

## Notes / likely code area

Status copy for this state is mapped in `src/renderer/src/components/status-bar/usage-error-copy.ts` for Claude `usageMetadata.failureKind` values:

- `stale-token`
- `refreshable-credentials-without-token`
- `delegated-refresh-required`

Those map to the exact user-visible strings:

- label: **Refreshing sign-in**
- detail: **Claude sign-in is being refreshed. Agent sessions may still be signed in.**

Related refresh/auth paths:

- `src/main/rate-limits/claude-fetcher.ts`
- `src/main/rate-limits/claude-usage-error-classification.ts`
- `src/main/claude-accounts/oauth-refresh.ts`
- `src/main/claude-accounts/live-pty-gate.ts`

Possible failure mode: delegated/stale-token refresh never completes (or never clears the failure kind), so usage polling keeps presenting “Refreshing sign-in” even though live Claude terminals remain authenticated.

## Related (not duplicates)

Prior usage-refresh bugs that were closed after older versions:

- #5355 — “Refresh failed” after update (auth path)
- #5627 — usage pills stop auto-refreshing after relaunch (focus-gated poll)
- #5809 — Claude usage broken on update

This report is on **1.4.137** with a different stuck UI string (**Refreshing sign-in**) and confirmed working terminal CC.

## Ask

Please investigate why Claude usage refresh can remain stuck in the “Refreshing sign-in” / recoverable-auth path while terminal sessions keep working, and restore reliable usage status updates.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.