Repository navigation
Conversation
…unts The host already publishes every provider in the accounts snapshot, but the Accounts screen only rendered Claude and Codex. Add a read-only usage section for Grok, Antigravity, Gemini, OpenCode Go, Kimi and MiniMax, shown only when the host has usage for that provider. Each extra provider is decoded on its own, so a malformed or foreign entry hides only that provider and never fails the Claude/Codex snapshot closed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Important
Including antigravity renders a second section carrying the Gemini numbers (or nothing). The host still produces Antigravity as { ...gemini, provider: 'antigravity' }, and desktop only shows that slot behind PATH detection plus a checked status-bar item — gates this screen cannot evaluate. The linked issue already flagged landing #9122 first.
Reviewed changes
- New extra-provider reader —
mobile/src/components/extra-provider-usage.tsdecodesgrok/antigravity/gemini/opencodeGo/kimi/minimaxfrom the snapshot's passthroughrateLimits, checks each provider identity, and keeps only entries thathasActiveProviderUsageaccepts. - New read-only section —
ProviderUsageSection.tsxrenders one card per provider usingUsageBar/getUsageBarState/getWindowResetLabel, pairing windows into two-bar rows with a filler for odd counts. - Monthly window support —
UsageWindowKeygains'monthly';getUsageBarStateandgetWindowResetLabelwiden to it, with no behavior change for existing callers. - Accounts wiring — extra sections render below Codex, above the footer hint.
- Tests — 9 new cases, each decoded through
decodeAccountsSnapshot, with exacttoEqualassertions.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| // RateLimitState field, provider is the identity the host stamps on it. | ||
| export const EXTRA_USAGE_PROVIDERS = [ | ||
| { key: 'grok', provider: 'grok', title: 'Grok' }, | ||
| { key: 'antigravity', provider: 'antigravity', title: 'Antigravity' }, |
There was a problem hiding this comment.
Antigravity is still the Gemini mirror on the host, so this entry produces a section with Gemini's exact numbers (or, when Gemini fails, nothing at all). Desktop only grants the slot when the Antigravity status-bar item is checked and PATH detection confirms the CLI; this screen has neither signal, and an identical duplicate is worse than the desktop behaviour it is copying.
Technical details
# Antigravity duplicates the Gemini section
## Affected sites
- `src/main/rate-limits/antigravity-usage-mirror.ts:13-15` — returns `{ ...gemini, provider: 'antigravity' }` whenever `gemini.status === 'ok'`; there is no independent Antigravity fetch.
- `src/renderer/src/components/status-bar/use-status-bar-controller.ts:107-123` — desktop requires `statusBarItems.includes('antigravity')`, `isStatusBarItemAvailable('antigravity', detectedAgentIds)`, and `geminiCliOAuthEnabled`.
- `mobile/src/components/extra-provider-usage.ts:12` — mobile applies none of those gates.
## Required outcome
- Two sections must not show the same usage, and Gemini usage must not be attributed to Antigravity.
## Suggested approach
- Skip the `antigravity` entry while a Gemini snapshot has active usage, or drop it until #9122 gives Antigravity a real source. If the entry is removed, `extra-provider-usage.test.ts` ("stable order") asserts `antigravity` is present and needs updating.
## Open questions for the human
- Is #9122 a prerequisite for surfacing Antigravity here, or should it be omitted until then?| continue | ||
| } | ||
| const limits = parsed.data | ||
| if (!hasActiveProviderUsage(limits)) { |
There was a problem hiding this comment.
A provider whose first fetch failed (status: 'error', no windows) is dropped here, so a signed-in Grok with an expired session or a Kimi with an expired token shows no section and no error text. That differs from desktop, which hides only unavailable and keeps error visible, and from #18469's ask for the existing "run X to refresh" states.
Technical details
# Error-only providers disappear
## Affected sites
- `mobile/src/components/extra-provider-usage.ts:42` — `hasActiveProviderUsage` returns false for `status: 'error'` with no windows.
- `mobile/src/components/account-usage-state.ts:63-76` — deliberate, and covered by `account-usage-state.test.ts:81`.
## Required outcome
- Decide whether a configured provider that has never fetched successfully should show its error copy. If yes, `error` needs to be distinguished from `unavailable` at this gate rather than folded into `hasActiveProviderUsage`.
## Open questions for the human
- Is hiding error-only providers intentional to keep the screen quiet, or an oversight from reusing `hasActiveProviderUsage`?| import type { ExtraProviderUsage } from '../components/extra-provider-usage' | ||
|
|
||
| const WINDOW_LABELS: Record<UsageWindowKey, string> = { | ||
| session: '5h', |
There was a problem hiding this comment.
Gemini's session is synthesized from its buckets, whose windowMinutes is 60, so labelling it 5h misstates the window (it can read "5h … Resets in 50m"). Desktop renders one row per model bucket instead of this synthetic summary.
Technical details
# Gemini's synthesized session is labelled as a 5h window
## Affected sites
- `src/main/rate-limits/gemini-usage-fetcher.ts:72` — `session: deriveSessionSummary(buckets)` picks the most-constrained bucket.
- `src/main/rate-limits/gemini-bucket-formatting.ts:43` — that bucket's `windowMinutes` is `60`.
- `mobile/src/accounts/ProviderUsageSection.tsx:12` — `WINDOW_LABELS.session = '5h'`.
- `src/renderer/src/components/status-bar/tooltip.tsx:145-153` — desktop renders bucket names instead.
## Required outcome
- Don't label a 60-minute window `5h`. Either render Gemini buckets by name or omit the synthetic session bar.|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe mobile Accounts screen now displays usage sections for supported providers beyond Claude and Codex. The new extraction helper validates provider rate limits and returns available session, weekly, and monthly windows. Usage bars show window labels, reset text, loading or empty states, and errors. The usage state helpers now support monthly windows. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Fix the missing first-poll error guidance and the misleading Gemini usage label before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description is detailed and covers the change, rationale, linked issue, implementation, testing, compatibility, and review considerations. However, the required visual proof for this UI change is not attached, and the checklist confirms that it is still pending.
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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a7c4f4f8-21d5-44e0-ad62-3ef1f0cdfc58
📒 Files selected for processing (7)
mobile/app/h/[hostId]/accounts.tsxmobile/src/accounts/ProviderUsageSection.tsxmobile/src/accounts/mobile-accounts-screen-styles.tsmobile/src/components/AccountUsage.tsxmobile/src/components/account-usage-state.tsmobile/src/components/extra-provider-usage.test.tsmobile/src/components/extra-provider-usage.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
|
||
| const WINDOW_LABELS: Record<UsageWindowKey, string> = { | ||
| session: '5h', | ||
| weekly: '7d', | ||
| monthly: '30d' | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,76p' mobile/src/accounts/ProviderUsageSection.tsx
rg -n 'session.*(hour|duration)|weekly.*(hour|day)|monthly.*(day|hour)|5h|7d|30d' mobile/src src | head -100Repository: stablyai/orca
Length of output: 12682
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- changed-file diff ---'
git diff --no-ext-diff --unified=80 122b8c25d7c16f76e395bf9a65887d7c4bc5003b 39b1265e3149829602403255c83308251faa286f -- mobile/src/accounts/ProviderUsageSection.tsx mobile/src/components/extra-provider-usage.ts mobile/src/components/AccountUsage.tsx mobile/src/accounts
printf '%s\n' '--- candidate files ---'
git ls-files | rg '(^|/)(extra-provider-usage|AccountUsage|ProviderUsageSection|.*provider.*usage.*|.*usage.*provider.*)' || true
printf '%s\n' '--- usage type and symbol references ---'
rg -n -S 'ExtraProviderUsage|ProviderUsageSection|UsageWindowKey|windowKey|session|weekly|monthly|resetAt|reset' mobile/src --glob '*.{ts,tsx}' | head -240Repository: stablyai/orca
Length of output: 43024
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions
Length of output: 36896
🏁 Script executed:
git diff --no-ext-diff --unified=80 122b8c25d7c16f76e395bf9a65887d7c4bc5003b 39b1265e3149829602403255c83308251faa286f -- mobile/src/accounts/ProviderUsageSection.tsx mobile/src/components/extra-provider-usage.ts mobile/src/components/AccountUsage.tsx mobile/src/accounts
rg -n -S 'ExtraProviderUsage|ProviderUsageSection|UsageWindowKey|session|weekly|monthly|resetAt|reset' mobile/src --glob '*.{ts,tsx}' | head -240Repository: stablyai/orca
Length of output: 41392
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- exact type/schema definitions ---'
rg -n -S 'ProviderRateLimitsSchema|type ProviderRateLimits|interface ProviderRateLimits|UsageWindowKey|RateLimitState' mobile/src src --glob '*.{ts,tsx}' | head -240
printf '%s\n' '--- accepted-provider producers and provider registrations ---'
rg -n -S 'grok|antigravity|opencode-go|opencodeGo|gemini|kimi|minimax' src/main mobile/src --glob '*.{ts,tsx}' | head -320
printf '%s\n' '--- section callers and screen wiring ---'
rg -n -S 'ProviderUsageSection|getExtraProviderUsage|EXTRA_USAGE_PROVIDERS|extraProvider' mobile/src --glob '*.{ts,tsx}' | head -200
printf '%s\n' '--- display conventions ---'
rg -n -S 'getProviderDisplayName|usage.*window|window.*label|reset.*label|Resets in|5h|7d|30d' src/renderer/src mobile/src --glob '*.{ts,tsx}' | head -260Repository: stablyai/orca
Length of output: 41582
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- exact type/schema definitions ---'
rg -n -S 'ProviderRateLimitsSchema|type ProviderRateLimits|interface ProviderRateLimits|UsageWindowKey|RateLimitState' mobile/src src --glob '*.{ts,tsx}' | head -240
printf '%s\n' '--- accepted-provider producers and registrations ---'
rg -n -S 'grok|antigravity|opencode-go|opencodeGo|gemini|kimi|minimax' src/main mobile/src --glob '*.{ts,tsx}' | head -320
printf '%s\n' '--- section callers and screen wiring ---'
rg -n -S 'ProviderUsageSection|getExtraProviderUsage|EXTRA_USAGE_PROVIDERS|extraProvider' mobile/src --glob '*.{ts,tsx}' | head -200
printf '%s\n' '--- display conventions ---'
rg -n -S 'getProviderDisplayName|usage.*window|window.*label|reset.*label|Resets in|5h|7d|30d' src/renderer/src mobile/src --glob '*.{ts,tsx}' | head -260Repository: stablyai/orca
Length of output: 41558
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- shared rate-limit contract ---'
sed -n '40,145p' src/shared/rate-limit-types.ts
printf '%s\n' '--- mobile schema and usage state ---'
sed -n '1,115p' mobile/src/components/accounts-snapshot.ts
sed -n '1,145p' mobile/src/components/account-usage-state.ts
printf '%s\n' '--- mobile caller reachability ---'
rg -n -S 'ProviderUsageSection|getExtraProviderUsage|EXTRA_USAGE_PROVIDERS' mobile/src --glob '*.{ts,tsx}'
rg -n -S 'rateLimits|accountsSnapshot|AccountsSnapshot' mobile/src/accounts mobile/src --glob '*.{ts,tsx}' | head -180
printf '%s\n' '--- rate-limit producer files ---'
git ls-files src/main | rg 'rate.limit|rate-limits|usage|provider' | head -220
rg -n -S 'ProviderRateLimits|session:|weekly:|monthly:|resetsAt|resetAt|window' src/main/rate-limits src/main/*usage* src/main/*provider* --glob '*.{ts,tsx}' 2>/dev/null | head -320Repository: stablyai/orca
Length of output: 41408
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- shared rate-limit contract ---'
sed -n '40,145p' src/shared/rate-limit-types.ts
printf '%s\n' '--- mobile schema and usage state ---'
sed -n '1,115p' mobile/src/components/accounts-snapshot.ts
sed -n '1,145p' mobile/src/components/account-usage-state.ts
printf '%s\n' '--- mobile caller reachability ---'
rg -n -S 'ProviderUsageSection|getExtraProviderUsage|EXTRA_USAGE_PROVIDERS' mobile/src --glob '*.{ts,tsx}'
rg -n -S 'rateLimits|accountsSnapshot|AccountsSnapshot' mobile/src/accounts mobile/src --glob '*.{ts,tsx}' | head -180
printf '%s\n' '--- rate-limit producer files ---'
git ls-files src/main | rg 'rate.limit|rate-limits|usage|provider' | head -220
rg -n -S 'ProviderRateLimits|session:|weekly:|monthly:|resetsAt|resetAt|window' src/main/rate-limits src/main/*usage* src/main/*provider* --glob '*.{ts,tsx}' 2>/dev/null | head -320Repository: stablyai/orca
Length of output: 42240
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- account route files and composition ---'
git ls-files mobile/src/accounts | sort
rg -n -S 'MobileAccounts|AccountsScreen|AccountUsage|ProviderUsage|snapshot|accounts' mobile/src/accounts --glob '*.{ts,tsx}' | head -260
printf '%s\n' '--- exact extra-provider tests ---'
sed -n '1,155p' mobile/src/components/extra-provider-usage.test.ts
printf '%s\n' '--- Gemini producer ---'
sed -n '1,255p' src/main/rate-limits/gemini-usage-fetcher.ts
rg -n -S 'deriveSessionSummary|windowMinutes|session:' src/main/rate-limits/gemini* --glob '*.{ts,tsx}'
printf '%s\n' '--- Kimi producer ---'
sed -n '160,270p' src/main/rate-limits/kimi-fetcher.ts
printf '%s\n' '--- OpenCode and Grok producer assignments ---'
rg -n -S 'windowMinutes|session:|weekly:|monthly:' src/main/rate-limits/opencode-go* src/main/rate-limits/grok* --glob '*.{ts,tsx}' | head -220Repository: stablyai/orca
Length of output: 28322
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- account route files and composition ---'
git ls-files mobile/src/accounts | sort
rg -n -S 'MobileAccounts|AccountsScreen|AccountUsage|ProviderUsage|snapshot|accounts' mobile/src/accounts --glob '*.{ts,tsx}' | head -260
printf '%s\n' '--- exact extra-provider tests ---'
sed -n '1,155p' mobile/src/components/extra-provider-usage.test.ts
printf '%s\n' '--- Gemini producer ---'
sed -n '1,255p' src/main/rate-limits/gemini-usage-fetcher.ts
rg -n -S 'deriveSessionSummary|windowMinutes|session:' src/main/rate-limits/gemini* --glob '*.{ts,tsx}'
printf '%s\n' '--- Kimi producer ---'
sed -n '160,270p' src/main/rate-limits/kimi-fetcher.ts
printf '%s\n' '--- OpenCode and Grok producer assignments ---'
rg -n -S 'windowMinutes|session:|weekly:|monthly:' src/main/rate-limits/opencode-go* src/main/rate-limits/grok* --glob '*.{ts,tsx}' | head -220Repository: stablyai/orca
Length of output: 28322
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- all mobile account route files ---'
git ls-files mobile | rg -i '(^|/)(app|accounts?)(/|\\.|$)|accounts' | head -220
printf '%s\n' '--- complete mobile references ---'
rg -n -S 'ProviderUsageSection|getExtraProviderUsage|EXTRA_USAGE_PROVIDERS' mobile --glob '*.{ts,tsx}' || true
printf '%s\n' '--- account route entrypoint candidates ---'
rg -n -S '\\[hostId\\]/accounts|mobileAccountsRouteTarget|accounts route|Accounts' mobile/app mobile/src --glob '*.{ts,tsx}' 2>/dev/null | head -220Repository: stablyai/orca
Length of output: 23616
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- all mobile account route files ---'
git ls-files mobile | rg -i '(^|/)(app|accounts?)(/|\.|$)|accounts' | head -220
printf '%s\n' '--- complete mobile references ---'
rg -n -S 'ProviderUsageSection|getExtraProviderUsage|EXTRA_USAGE_PROVIDERS' mobile --glob '*.{ts,tsx}' || true
printf '%s\n' '--- account route entrypoint candidates ---'
rg -n -S '\[hostId\]/accounts|mobileAccountsRouteTarget|accounts route|Accounts' mobile/app mobile/src --glob '*.{ts,tsx}' 2>/dev/null | head -220Repository: stablyai/orca
Length of output: 24036
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- line-numbered reviewed path ---'
nl -ba mobile/src/accounts/ProviderUsageSection.tsx | sed -n '8,52p'
nl -ba mobile/app/h/'[hostId]'/accounts.tsx | sed -n '376,392p'
nl -ba mobile/src/components/extra-provider-usage.ts | sed -n '8,47p'
printf '%s\n' '--- Gemini duration producer ---'
nl -ba src/main/rate-limits/gemini-bucket-formatting.ts | sed -n '32,88p'
nl -ba src/main/rate-limits/gemini-bucket-formatting.test.ts | sed -n '20,45p'
nl -ba src/main/rate-limits/gemini-usage-fetcher.ts | sed -n '64,78p'
printf '%s\n' '--- existing duration-label helpers/conventions ---'
rg -n -S 'format.*(Duration|Window|Minutes)|windowMinutes.*(60|300|10080|43200)|minutes.*(hour|day)|\\b[0-9]+h\\b|\\b[0-9]+d\\b' mobile/src src/shared src/main/rate-limits --glob '*.{ts,tsx}' | head -240Repository: stablyai/orca
Length of output: 20207
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- line-numbered reviewed path ---'
nl -ba mobile/src/accounts/ProviderUsageSection.tsx | sed -n '8,52p'
nl -ba mobile/app/h/'[hostId]'/accounts.tsx | sed -n '376,392p'
nl -ba mobile/src/components/extra-provider-usage.ts | sed -n '8,47p'
printf '%s\n' '--- Gemini duration producer ---'
nl -ba src/main/rate-limits/gemini-bucket-formatting.ts | sed -n '32,88p'
nl -ba src/main/rate-limits/gemini-bucket-formatting.test.ts | sed -n '20,45p'
nl -ba src/main/rate-limits/gemini-usage-fetcher.ts | sed -n '64,78p'
printf '%s\n' '--- existing duration-label helpers/conventions ---'
rg -n -S 'format.*(Duration|Window|Minutes)|windowMinutes.*(60|300|10080|43200)|minutes.*(hour|day)|\b[0-9]+h\b|\b[0-9]+d\b' mobile/src src/shared src/main/rate-limits --glob '*.{ts,tsx}' | head -240Repository: stablyai/orca
Length of output: 38309
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- existing window-label implementations ---'
rg -n -S 'formatWindowLabel|window label|windowMinutes' src/renderer/src src/main/rate-limits mobile/src --glob '*.{ts,tsx}' | rg -v 'test|__fixtures__' | head -220
printf '%s\n' '--- shared duration formatter ---'
nl -ba src/shared/rate-limit-reset-format.ts | sed -n '1,38p'Repository: stablyai/orca
Length of output: 5675
Derive extra-provider labels from windowMinutes.
The accounts route renders Gemini usage. Gemini emits a 60-minute session window, but this component labels every session as 5h. The desktop usage convention formats labels from windowMinutes. Use the payload duration here as well.
Suggested fix
-const WINDOW_LABELS: Record<UsageWindowKey, string> = {
- session: '5h',
- weekly: '7d',
- monthly: '30d'
+function getWindowLabel(limits: ExtraProviderUsage['limits'], windowKey: UsageWindowKey): string {
+ const windowMinutes = limits[windowKey]?.windowMinutes
+ if (windowMinutes == null) return ''
+ if (windowMinutes % (60 * 24) === 0) return `${windowMinutes / (60 * 24)}d`
+ if (windowMinutes % 60 === 0) return `${windowMinutes / 60}h`
+ return `${windowMinutes}m`
}
...
- label={WINDOW_LABELS[windowKey]}
+ label={getWindowLabel(limits, windowKey)}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const WINDOW_LABELS: Record<UsageWindowKey, string> = { | |
| session: '5h', | |
| weekly: '7d', | |
| monthly: '30d' | |
| } | |
| function getWindowLabel(limits: ExtraProviderUsage['limits'], windowKey: UsageWindowKey): string { | |
| const windowMinutes = limits[windowKey]?.windowMinutes | |
| if (windowMinutes == null) return '' | |
| if (windowMinutes % (60 * 24) === 0) return `${windowMinutes / (60 * 24)}d` | |
| if (windowMinutes % 60 === 0) return `${windowMinutes / 60}h` | |
| return `${windowMinutes}m` | |
| } |
| if (!hasActiveProviderUsage(limits)) { | ||
| continue |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n 'errorProvider|status: .error.|fetch.*[Gg]emini|fetch.*[Gg]rok|fetch.*[Mm]ini[Mm]ax' src/main/rate-limits | head -110
sed -n '1,170p' src/main/rate-limits/service-live-claude-usage.test.tsRepository: stablyai/orca
Length of output: 17521
🏁 Script executed:
set -eu
printf '%s\n' '--- helper and related mobile code ---'
cat -n mobile/src/components/extra-provider-usage.ts
rg -n -A35 -B10 'ProviderRateLimitsSchema|hasActiveProviderUsage|ProviderUsageSection|getExtraProviderUsage' mobile/src/components mobile/src/accounts mobile/app/h/\[hostId\]/accounts.tsx
printf '%s\n' '--- service provider ingestion and state shaping ---'
rg -n -A35 -B12 'fetchGeminiRateLimits|fetchGrokRateLimits|fetchKimiRateLimits|fetchOpenCodeGoUsage|fetchMiniMaxRateLimits|status: .error.|set.*Rate|provider.*status' src/main/rate-limits/service.ts src/main/rate-limits/gemini-usage-fetcher.ts src/main/rate-limits/grok-fetcher.ts src/main/rate-limits/kimi-fetcher.ts src/main/rate-limits/opencode-go-usage-fetcher.ts src/main/rate-limits/minimax/minimax-fetcher.tsRepository: stablyai/orca
Length of output: 42561
🏁 Script executed:
set -eu
printf '%s\n' '--- helper and related mobile code ---'
cat -n mobile/src/components/extra-provider-usage.ts
rg -n -A35 -B10 'ProviderRateLimitsSchema|hasActiveProviderUsage|ProviderUsageSection|getExtraProviderUsage' mobile/src/components mobile/src/accounts 'mobile/app/h/[hostId]/accounts.tsx'
printf '%s\n' '--- service provider ingestion and state shaping ---'
rg -n -A35 -B12 'fetchGeminiRateLimits|fetchGrokRateLimits|fetchKimiRateLimits|fetchOpenCodeGoUsage|fetchMiniMaxRateLimits|status: .error.|set.*Rate|provider.*status' src/main/rate-limits/service.ts src/main/rate-limits/gemini-usage-fetcher.ts src/main/rate-limits/grok-fetcher.ts src/main/rate-limits/kimi-fetcher.ts src/main/rate-limits/opencode-go-usage-fetcher.ts src/main/rate-limits/minimax/minimax-fetcher.tsRepository: stablyai/orca
Length of output: 42637
🏁 Script executed:
set -eu
cat -n mobile/src/components/extra-provider-usage.ts
rg -n -A35 -B10 'ProviderRateLimitsSchema|hasActiveProviderUsage|getExtraProviderUsage' mobile/src/components
rg -n -A35 -B12 'fetchGeminiRateLimits|fetchGrokRateLimits|fetchKimiRateLimits|fetchOpenCodeGoUsage|fetchMiniMaxRateLimits|status: .error.|set.*Rate|provider.*status' src/main/rate-limits/service.ts src/main/rate-limits/gemini-usage-fetcher.ts src/main/rate-limits/grok-fetcher.ts src/main/rate-limits/kimi-fetcher.ts src/main/rate-limits/opencode-go-usage-fetcher.ts src/main/rate-limits/minimax/minimax-fetcher.tsRepository: stablyai/orca
Length of output: 42897
🏁 Script executed:
set -eu
rg -n -A45 -B20 'fetchOpenCodeGoUsage|fetchKimiRateLimits|fetchGeminiRateLimits|fetchGrokRateLimits|fetchMiniMaxRateLimits|rateLimits|apply.*Provider|update.*Provider|providerResult' src/main/rate-limits/service.tsRepository: stablyai/orca
Length of output: 151
🏁 Script executed:
set -u
printf '%s\n' '--- service files ---'
fd -t f -i 'service|rate-limit' src/main/rate-limits | head -80
printf '%s\n' '--- service bindings ---'
rg -n -i -A30 -B15 'opencode|fetch.*rate.?limit|ProviderRateLimits|rateLimits' src/main/rate-limits --glob '*.ts' | head -260Repository: stablyai/orca
Length of output: 25151
🏁 Script executed:
set -eu
rg -n -A55 -B20 -i 'opencode|fetch.*provider|ProviderRateLimits|apply.*result|status.*error|rateLimits' \
src/main/rate-limits/service/service-provider-cycles.ts \
src/main/rate-limits/service/service-full-cycle-application.ts \
src/main/rate-limits/service/service-state.ts \
src/main/rate-limits/service.tsRepository: stablyai/orca
Length of output: 41990
🏁 Script executed:
set -eu
cat -n src/main/rate-limits/service/service-result-policy.ts
sed -n '120,195p' src/main/rate-limits/service/service-full-cycle-application.tsRepository: stablyai/orca
Length of output: 7515
🐛 Suggested fix
- if (!hasActiveProviderUsage(limits)) {
+ if (!hasActiveProviderUsage(limits) && !(limits.status === 'error' && limits.error)) {
continueKeep initial extra-provider errors visible.
OpenCode Go fetch failures return status: 'error' with an error message and no usage windows. On the initial poll, the service applies that result because no previous state exists. The mobile filter then drops it, so the Accounts screen cannot display the error. Retain error entries with a message while continuing to hide unavailable entries.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (!hasActiveProviderUsage(limits)) { | |
| continue | |
| if (!hasActiveProviderUsage(limits) && !(limits.status === 'error' && limits.error)) { | |
| continue |
|
Thanks for working on this! #38187 just merged and shows usage on mobile for every provider the desktop tracks, so I'm closing this in favour of it. Your work here helped shape that change. |

ELI5
The desktop status bar can show usage for Grok, Antigravity, Gemini, OpenCode Go, Kimi and MiniMax, but the phone's Accounts screen only ever showed Claude and Codex. The phone was already receiving the other numbers from the desktop and throwing them away. This PR shows them.
What Changed
Before: Mobile → host → Accounts lists Claude and Codex only, even when the desktop has live Grok (or other) usage.
After: Below Claude and Codex, each other provider that has usage on the host gets its own read-only section with the same bars the Claude/Codex rows use:
5h,7dand, new here,30d(Grok and OpenCode Go report a monthly window). Reset countdowns and the last error line work the same way. Providers the host has no sign-in for stay hidden, so a Claude-only user sees no change.Mechanism:
RateLimitState(RuntimeAccountController.getSnapshot()returnsrateLimits: rateLimits.getState()), so there is no host or wire change.extra-provider-usage.tsreadsgrok,antigravity,gemini,opencodeGo,kimi,minimaxfrom the snapshot, decodes each one on its own with the existingProviderRateLimitsSchema, checks the provider identity, and keeps only entries thathasActiveProviderUsagesays are worth showing.ProviderUsageSection.tsxrenders one section per provider, reusingUsageBar,getUsageBarStateandgetWindowResetLabel. Those two selectors now also accept'monthly'.Why
decodeAccountsSnapshotfails closed on purpose. If a newer host sends an extra provider in a shape this phone does not understand, adding the fields to the strict schema would blank the Claude and Codex sections too. Decoding each extra provider on its own means a bad entry only hides that provider.docs/reference/remote-wire-compatibility.md, this needs no capability negotiation.Linked Issue
Fixes #18469
Visual Proof
Before/after screenshots of the Accounts screen from the iOS simulator will be added in a follow-up comment (dev-client build in progress). The only visual change is the extra read-only sections below Codex. Existing Claude/Codex sections are untouched.
Testing
mobile/src/components/extra-provider-usage.test.ts(9 tests), each run throughdecodeAccountsSnapshotso it covers what the phone keeps from a real host payload:opencodeGomaps to theopencode-goprovider id.vitest runfor the account usage files: 37/37 pass (28 existing + 9 new).Full mobile suite: 9432 passed. The 14 failing files fail identically on unmodified
mainin this checkout because they import root-workspace packages (typescript-api,oxc-parser) that a mobile-only install does not provide.tsc --noEmit: same 7 pre-existing errors asmain, none in the changed files.oxlintis clean on the changed files, andoxfmt --checkis clean.Platforms: logic tested on macOS. The UI uses only existing React Native primitives and styles, with no platform branches.
I manually tested these changes locally (simulator screenshots pending, see Visual Proof)
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code (Claude Opus 5.5). The author reviewed the change and the test results.
Review
Self-review:
safeParseper extra provider per snapshot, six at most.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No desktop, host or protocol change. Mobile only.
Checklist
N/Awith reason (to follow in a comment)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Mobile-scoped checks were run locally as listed above; the root desktop checks are left to CI because this PR does not touch the desktop.🤖 Generated with Claude Code