Repository navigation
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 29.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 10 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the primary change: adding Grok usage to the mobile home and Accounts screens. Description check ✅ Passed The description is detailed and covers the user impact, implementation, scope, linked issues, testing, compatibility, and review considerations. The UI visual-proof requirement is not fully met becaus… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Grok selectors — new
mobile/src/components/grok-account-usage.tsre-parses therateLimits.grokslot in isolation withProviderRateLimitsSchema(dropping a malformed or foreign-provider slot without failing Claude/Codex), readsgrokAuthConfiguredvia a cast, and picks weekly → monthly fallback. - Home visibility gate —
hostShowsAccountUsage(Claude || Codex || Grok) replaces the inline Claude/Codex check inuse-mobile-home-data.ts, so a Grok-only desktop now renders the Account usage card. - Home row —
MobileHomeAccountUsageCards.tsxadds a single-bar Grok row (no reset line) plus itsgrok.limits?.errorline. - Accounts section — new read-only
GrokAccountUsageSection.tsx, mounted inaccounts.tsx, with the live reset countdown. UsageBar— newlabelWidthprop (default22preserves existing callers) so the wider30dlabel is not clipped; the reset-text indent now derives from it.- Window type —
UsageWindowKeygains'monthly'; tests extendgetWindowResetLabel/getUsageBarStatecoverage for the monthly window.
I verified the mechanism end to end: the host's rateLimits.getState() already publishes grok and grokAuthConfigured, and the mobile snapshot's .passthrough() retains both, so this is display-only with no wire change. Window selection matches the desktop status-bar monthly-only Grok path and the fetcher (which emits weekly XOR monthly). The mobile tests (47) pass, oxlint on the touched files is clean, and tsc -p mobile/tsconfig.test.json reports no errors in the touched files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: b972c712-1f4a-486e-8243-9fd3b8daa4e1
📥 Commits
Reviewing files that changed from the base of the PR and between a85057e and 5c9eb4d2118aad806bea0e7d9a59e7abd4394291.
📒 Files selected for processing (10)
mobile/app/h/[hostId]/accounts.tsxmobile/src/accounts/GrokAccountUsageSection.tsxmobile/src/components/AccountUsage.tsxmobile/src/components/account-usage-state.test.tsmobile/src/components/account-usage-state.tsmobile/src/components/grok-account-usage-surfaces.test.tsxmobile/src/components/grok-account-usage.test.tsmobile/src/components/grok-account-usage.tsmobile/src/home/MobileHomeAccountUsageCards.tsxmobile/src/home/use-mobile-home-data.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
5c9eb4d to
38ee2be
Compare
Sync update (
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Grok row now requires a real meter —
getGrokAccountUsage(mobile/src/components/grok-account-usage.ts:86) replaces thehasActiveProviderUsage(limits)check withreadGrokWindowKey(limits), so a host withgrokAuthConfigured: falseand astatus: 'ok'response that carries no weekly/monthly window no longer renders a "Signed in" row with no bar. This addresses the CodeRabbit finding on the prior revision; the signed-in loading path (authConfiguredtrue, no window yet) is unchanged. - Regression test added —
grok-account-usage.test.ts:163assertsgetGrokAccountUsage/hostShowsAccountUsagereturn null /falsefor{ status: 'ok', weekly: null, monthly: null }with auth unconfigured. The assertion fails against the pre-fix guard, so it is real coverage rather than a tautology.
I confirmed the fix is complete: the desktop Grok fetcher emits weekly XOR monthly and never session or buckets (src/main/rate-limits/grok-fetcher.ts:329-347), so readGrokWindowKey covers every usage shape the host can publish and no non-Grok path in the module regressed. No unresolved pullfrog threads remain on this PR.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
38ee2be to
fa14777
Compare
fa14777 to
a4593b2
Compare
[Medium impact] Adds Grok usage display to home and accounts screens. The PR should not merge until the new wiring test is corrected to inspect the component it asserts against. FindingsSummaryThe PR adds read-only Grok usage to the mobile home card and Accounts screen, using the paired desktop’s existing account snapshot.
|
| const accounts = readFileSync( | ||
| new URL('../../app/h/[hostId]/accounts.tsx', import.meta.url), | ||
| 'utf8' | ||
| ) |
There was a problem hiding this comment.
Wiring test reads wrong route. When the new test runs, it reads the native
accounts.tsx route and expects to find <GrokAccountUsageSection. That route renders MobileWebShellScreen; the Grok section is mounted in MobileAccountsScreen.tsx. The assertion therefore fails, breaking the test run.
| const accounts = readFileSync( | |
| new URL('../../app/h/[hostId]/accounts.tsx', import.meta.url), | |
| 'utf8' | |
| ) | |
| const accounts = readFileSync( | |
| new URL('../accounts/MobileAccountsScreen.tsx', import.meta.url), | |
| 'utf8' | |
| ) |
| } | ||
| return { | ||
| limits, | ||
| label: readAuthProvenance(limits) ?? 'Signed in', |
There was a problem hiding this comment.
Fallback label is untranslated. When the host sends no account provenance, the Grok row shows the hard-coded English text “Signed in”. Unlike the existing Accounts screen labels, it will not follow the mobile UI language, leaving the row partly untranslated.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The paired desktop already publishes Grok rate limits on the accounts snapshot. Show that read-only meter beside Claude and Codex, including weekly credits and monthly unified billing. Preserves Claude and Codex account switching. A host with neither a Grok CLI session nor a usable meter still shows no Grok row.
a4593b2 to
7f0d7e5
Compare
|
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 iOS home screen and Accounts screen already show how much Claude and Codex usage is left. Grok was missing there even when the Mac app's status bar showed a signed-in Grok meter. This adds that Grok meter.
What Changed
Before: The phone's Account usage card and Accounts screen list Claude and Codex only. A signed-in Grok CLI session on the paired desktop is invisible.
After: When the desktop has a Grok CLI session or a usable Grok meter, the home card shows one Grok row and the Accounts screen shows a read-only Grok section. Weekly credit plans use the
7dbar. Unified-billing plans that only have a monthly included budget use the30dbar, with the same reset countdown the other account rows use. The label is the desktop account provenance (email and tier) when the host sends it, otherwise "Signed in". Hosts that are not signed in to Grok and have no meter stay unchanged.Mechanism:
accounts.list/accounts.subscribealready returnrateLimits.getState(), which includesgrokandgrokAuthConfigured. The phone was keeping those fields through the snapshot's passthrough and never rendering them. Grok is decoded on its own, so a malformed Grok payload cannot blank Claude or Codex. There is no new RPC and no account switch: Grok is one CLI session on the computer running Orca.Why
The home card is the surface people see without opening Accounts. Showing every other desktop provider here would also pull in Antigravity, whose status-bar slot is still a Gemini mirror, and Cursor, which is a separate schema gap. Those stay out of this change. #22626 proposes the wider Accounts-screen set and leaves the home card for later.
Focused fix
Preserves
grokstill decode. A bad Grok object is dropped by itself.Evidence
cd mobile && pnpm exec vitest run src/components/grok-account-usage.test.ts src/components/grok-account-usage-surfaces.test.tsx src/components/account-usage-state.test.ts src/components/accounts-snapshot.test.ts src/accounts/mobile-accounts-route.test.ts7d, percent, account label) and the Accounts section (30d, reset countdown), plus the hidden signed-out case.pnpm exec oxlinton the touched files reported 0 errors.tsc -p tsconfig.test.jsonreported no errors in the touched files.User-regression-tradeoffs
5hand7dwithout a reset line. Only the Grok row is a single window.30dlabel is slightly wider than5h/7dso it is not clipped. Other bars keep the old label width.Linked Issue
Refs #18469
Refs #22648
This does not close those issues. #18469 also asks for the other desktop providers on the Accounts screen. #22648 also asks for those providers, plus Cursor, on the home card. #22626 is the open proposal for the wider Accounts-screen set.
Visual Proof
No simulator screenshot in this PR. The rendered home card and Accounts section are asserted in
grok-account-usage-surfaces.test.tsx(account label,7d/30d, percent, and reset text). A signed-out host renders no Grok row.Testing
cd mobile && pnpm exec vitest run src/components/grok-account-usage.test.ts src/components/grok-account-usage-surfaces.test.tsx src/components/account-usage-state.test.ts src/components/accounts-snapshot.test.ts src/accounts/mobile-accounts-route.test.tspnpm exec oxlinton the touched mobile filesPlatforms: logic tested on macOS. No iOS simulator pass against a live desktop. No Linux, Windows, or SSH manual pass. The phone only renders the snapshot the paired desktop already publishes, and the new code has no platform branch.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Grok (xAI). The change and the test results were reviewed in this session.
Review
Self-review:
decodeAccountsSnapshot.safeParseof the Grok slot per snapshot.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.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Mobile-scoped vitest, oxlint on the touched files, and a test-projecttsccheck of those files were run locally. The root desktop suite was not run because this PR does not change the desktop.