Repository navigation
feat(mobile): render all active agent usage providers - #32058
zhangxaochen wants to merge 2 commits into
Conversation
Accounts only decoded Claude and Codex, so the other providers in the host snapshot never appeared. - Group Antigravity pools, and show Cursor plan meters plus named buckets. - Use email provenance when the host sends it, otherwise System default. - Hide an empty Claude or Codex card when another provider is active.
Walkthrough
Priority: Merge Risk:
|
…-accounts-all-providers
[Medium impact] The change affects the mobile Accounts workflow across active agent providers. Fix the Antigravity bucket decoder before merging; a supported host value can make the entire Accounts screen unavailable. Findings
SummaryThis PR adds mobile usage sections for eight more providers.
Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile |
| RateLimitWindowSchema.extend({ | ||
| name: z.string().min(1), | ||
| group: z.string().optional(), | ||
| windowName: z.string().optional() | ||
| }).passthrough() |
There was a problem hiding this comment.
The host uses windowMinutes: 0 for Antigravity windows it cannot map, such as monthly, and sends those buckets unchanged. These buckets inherit the .positive() check from RateLimitWindowSchema, so one valid bucket rejects the entire snapshot. Mobile then clears all account sections and shows Invalid accounts snapshot from host.
Allow zero for bucket durations while keeping ordinary windows strict, and add a decoder test for this host-supported case.
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5d3c8e8c-2bfe-4d30-b3c1-b1a4cbf0d96f
Files selected for processing: 5-
mobile/src/accounts/MobileAccountsScreen.tsxmobile/src/components/AccountUsage.tsxmobile/src/components/account-usage-state.test.tsmobile/src/components/account-usage-state.tsmobile/src/components/accounts-snapshot.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
| gemini: ProviderRateLimitsSchema.nullable().optional(), | ||
| opencodeGo: ProviderRateLimitsSchema.nullable().optional(), | ||
| kimi: ProviderRateLimitsSchema.nullable().optional(), | ||
| antigravity: ProviderRateLimitsSchema.nullable().optional(), | ||
| minimax: ProviderRateLimitsSchema.nullable().optional(), | ||
| grok: ProviderRateLimitsSchema.nullable().optional(), | ||
| cursor: ProviderRateLimitsSchema.nullable().optional(), | ||
| zcode: ProviderRateLimitsSchema.nullable().optional(), |
There was a problem hiding this comment.
Validate each additional provider’s identity.
A snapshot with rateLimits.grok.provider: 'zcode' passes decoding. The screen then presents those limits under Grok, while the row selector can label the monthly quota MCP from the embedded zcode identity. Add provider-identity checks for the new keys, as the schema already does for Claude and Codex. (raw.githubusercontent.com)
|
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
On Orca Mobile, the host Accounts & Usage screen (
/h/[hostId]/accounts) previously only decoded and rendered Claude and Codex, even though the desktop host already sends usage data for all active agents (Antigravity,Cursor,Grok,Gemini,OpenCode Go,Kimi,MiniMax, andZ.ai) in theaccounts.list/accounts.subscribesnapshot. This updates the mobile Accounts screen to display usage bars and reset countdowns for all active providers on the host.What Changed
AccountsSnapshotSchemainmobile/src/components/accounts-snapshot.tsonly declaredrateLimits.claudeandrateLimits.codex(and omitted'zcode'fromProviderRateLimitsSchema).MobileAccountsScreen.tsxonly renderedClaudeandCodexsections, hiding all other active providers (Antigravity,Cursor,Grok,Gemini,OpenCode Go,Kimi,MiniMax,Z.ai) and leaving an emptyClaudecard visible even when the user had no Claude accounts or usage.ProviderRateLimitsSchemaandAccountsSnapshotSchemainmobile/src/components/accounts-snapshot.tsto decode optional provider rate-limit snapshots (antigravity,gemini,cursor,grok,opencodeGo,kimi,minimax,zcode), includingbuckets(group,windowName),planType, andusageMetadata.getActiveAdditionalProviders,getAdditionalProviderUsageRows, andhasAnyRenderableUsageinmobile/src/components/account-usage-state.ts:Antigravitymodel groupsGemini Models,Claude and GPT models): renders one row per model group with sorted window bars (5h,7d) and reset countdowns.CursorPlan30d+Cursor Models/Other Models,GeminiFlash/Pro): renders the plan meter (when present) and each named bucket row.Grok,OpenCode Go,Kimi,MiniMax,Z.ai): renders the account provenance (usageMetadata.authProvenanceemail when available, otherwiseSystem default) with active5h/7d/Fable/30d/MCPbars.AdditionalProvidersUsageSectionsinmobile/src/components/AccountUsage.tsxand rendered it onMobileAccountsScreen.tsx, while hiding empty unconfiguredClaude/Codexcards when another provider is active.Why
The desktop host's
RuntimeAccountController.getSnapshot()already publishes the fullRateLimitStateoveraccounts.listandaccounts.subscribe, so no new RPC or protocol change is needed. Keeping the new selectors and section renderer insideaccount-usage-state.tsandAccountUsage.tsxalso preserves the exact route chunk-splitting envelope enforced byverify-mobile-web-app-bundle.mjs.Linked Issue
Fixes #18469
Visual Proof
Verified on Android (
com.stably.orca.mobileconnected to Windows desktop host): the Accounts screen now rendersCodex,Antigravity(Gemini Models5h/7d &Claude and GPT models5h/7d),Cursor(Plan30d,Cursor Models,Other Models), andGrok([email protected]7d) instead of onlyCodexand an emptyClaudecard.Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
pnpm --dir mobile test src/components/accounts-snapshot.test.ts src/components/account-usage-state.test.ts src/accounts/mobile-accounts-screen-reset-credit.test.tsnode config/scripts/build-mobile-web-app-bundle.mjs && node config/scripts/verify-mobile-web-app-bundle.mjspnpm exec oxlint --deny-warnings mobile/src/accounts/MobileAccountsScreen.tsx mobile/src/components/AccountUsage.tsx mobile/src/components/account-usage-state.ts mobile/src/components/account-usage-state.test.ts mobile/src/components/accounts-snapshot.ts mobile/src/components/accounts-snapshot.test.ts src/shared/codex-reset-credit-scope.tsAI Disclosure
Assisted by Gemini (
Antigravity) and Grok (grok-4.7-build-fast) for implementation and unit tests.Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)