Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2

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:
3abe910b-3cf0-4971-bea9-33a64b82953e
Files selected for processing: 40-
mobile/app/_layout.web.tsxmobile/src/components/AccountUsage.tsxmobile/src/components/composer-input/MessageBox.tsxmobile/src/components/mounted-bottom-drawer.tsxmobile/src/composer-usage/ComposerUsageMeter.tsxmobile/src/composer-usage/ComposerUsageSheet.tsxmobile/src/composer-usage/ComposerUsageWindowPicker.tsxmobile/src/composer-usage/ComposerUsageWindowRow.tsxmobile/src/composer-usage/accounts-snapshot-store.test.tsmobile/src/composer-usage/accounts-snapshot-store.tsmobile/src/composer-usage/agent-usage-provider.test.tsmobile/src/composer-usage/agent-usage-provider.tsmobile/src/composer-usage/composer-usage-client-context.tsmobile/src/composer-usage/composer-usage-window-preference.tsmobile/src/composer-usage/usage-window-pace.test.tsmobile/src/composer-usage/usage-window-pace.tsmobile/src/i18n/locales/en.jsonmobile/src/layout/released-side-inset.tsmobile/src/layout/side-safe-area.tsxmobile/src/mobile-web-shell/MobileWebShellScreen.tsxmobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.tsmobile/src/mobile-web-shell/page-storage-keys.tsmobile/src/session/MobileNativeChatView.prompt-presentation.test.tsmobile/src/session/MobileNativeChatView.tsxmobile/src/session/MobileSessionActiveContent.tsxmobile/src/session/MobileSessionCommandDock.test.tsxmobile/src/session/MobileSessionCommandDock.tsxmobile/src/session/MobileSessionContentRow.tsxmobile/src/session/MobileSessionHeader.tsxmobile/src/session/MobileSessionSurface.tsxmobile/src/session/duo-chat-width.tsmobile/src/session/mobile-prompt-controller.test.tsmobile/src/session/native-chat/composer/MobileNativeChatActionGap.tsxmobile/src/session/native-chat/composer/MobileNativeChatComposer.tsxmobile/src/session/native-chat/composer/MobileNativeChatWidthToggle.tsxmobile/src/session/native-chat/composer/mobile-native-chat-composer-styles.tsmobile/src/session/native-chat/composer/use-chat-bottom-fit.tsmobile/src/session/session-side-strip-inset.tsmobile/src/session/use-mobile-session-presentation.tsmobile/src/settings/native-chat-settings-screen.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Support ZCode usage in the mobile provider adapter. · agent-usage-provider.ts:17-29
mobile/src/composer-usage/agent-usage-provider.ts:17-29
Minor · Functional Correctness · Quick win Support ZCode usage in the mobile provider adapter.
The host already produces
zcodeusage. The mobile schema rejects its provider identity, and the composer map does not select it. Addzcodeto both provider boundaries. Do not mapmimo-codetominimax; the repository treats MiniMax as a separate provider and defines no such binding.Suggested fix
diff --git a/mobile/src/components/accounts-snapshot.ts b/mobile/src/components/accounts-snapshot.ts @@ 'kimi', 'minimax', + 'zcode', 'grok', diff --git a/mobile/src/composer-usage/agent-usage-provider.ts b/mobile/src/composer-usage/agent-usage-provider.ts @@ | 'kimi' + | 'zcode' | 'antigravity' @@ ['kimi', 'kimi'], + ['zcode', 'zcode'], ['antigravity', 'antigravity'], @@ kimi: 'kimi', + zcode: 'zcode', antigravity: 'antigravity', @@ kimi: 'Kimi', + zcode: 'ZCode', antigravity: 'Antigravity',

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:
286e53c7-7100-41b8-a0b8-4b9d81dc87d4
Files selected for processing: 1-
mobile/src/composer-usage/agent-usage-provider.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 2

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:
fc7e2dee-b088-4b2e-b2f3-40fe07a7e249
Files selected for processing: 6-
mobile/src/composer-usage/ComposerUsageMeter.tsxmobile/src/composer-usage/ComposerUsageWindowRow.tsxmobile/src/composer-usage/agent-usage-provider.test.tsmobile/src/composer-usage/agent-usage-provider.tsmobile/src/composer-usage/usage-window-pace.test.tsmobile/src/composer-usage/usage-window-pace.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
69e6186 to
d155c74
Compare
991ef70 to
b6fba0e
Compare
bbdbc70 to
bf61573
Compare
…he bottom edge Duo chats can run across the status column, with a composer toggle to switch the width, a header that stays clear of the column, and a bottom-edge composer fit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Adds the composer usage meter (used/remaining toggle, 5-hour and weekly windows, run-out projection) on the shared provider usage sheet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
bf61573 to
d9ab382
Compare
The usage slot was flex:1 (basis 0) beside the growing leading controls, so they split the free space and the slot squeezed the window/percent labels. Size the slot to the meter, stop the labels shrinking, and let the bar give way. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Backport the usage-only changes from stablyai#36746, adapting module paths and composer integration to v1.4.258. Source commits: d9ab382 and da3c696. Keep the stacked iPhone Duo layout change out of this integration. Co-authored-by: gsxdsm <[email protected]>
|
Thanks for this, @gsxdsm. We took the Used/Remaining preference from here, your per-device store, and made the phone's Home and Accounts usage bars follow it from a Settings › Appearance choice in #43864, with you as co-author. We're leaving the composer usage meter for later, so this PR stays open for now. |
…t-full-width Keep full-width Duo chat on top of the moved mobile modules.
# Conflicts: # mobile/src/components/bottom-drawer/mounted-bottom-drawer.tsx # mobile/src/mobile-web-shell/MobileWebShellScreen.tsx # mobile/src/mobile-web-shell/bridge/bridge-rpc-client-frames.test.ts # mobile/src/mobile-web-shell/page-storage/page-storage-keys.ts # mobile/src/session/MobileSessionActiveContent.tsx # mobile/src/session/MobileSessionCommandDock.tsx # mobile/src/session/MobileSessionContentRow.tsx # mobile/src/session/MobileSessionSurface.tsx # mobile/src/session/mobile-prompt-controller.test.ts # mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts # mobile/src/session/native-chat/MobileNativeChatView.tsx # mobile/src/session/native-chat/composer/MobileNativeChatComposer.keyboard.web.test.tsx # mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx # mobile/src/session/native-chat/composer/field/mobile-native-chat-composer-styles.ts # mobile/src/session/use-mobile-session-presentation.ts # mobile/src/settings/native-chat-settings-screen.tsx # mobile/web-entry/index.tsx
The idle pill collapsed and unmounted the meter before onPress, and the pop-up lived inside that meter so dismissing the keyboard closed it. Taps keep the field focused, and the sheet is hosted above the composer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pace color takes the palette from the component, reset-label modes are not copy, and the history schemas build on first use. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The composer meter and its pop-up add about 28 KB to the page. The fence was 21 KB under the cap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Updated onto current main. Tapping the usage bar keeps the composer focused, and the pop-up is hosted above the composer so it stays mounted. Pace color takes the palette from the component. The web eager fence is now 12,746,752 bytes; this branch measures 12,725,457 and |
The phone runtime defines HTMLElement, and the bar's host ref matched it without addEventListener, so the meter crashed on open. Only a DOM node keeps the tap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Simulator shot of the composer meter on a cloned iPhone. The numbers are sample data, and the route title is the preview screen, not the product. The top bar is the controls-row meter. Tapping the bar no longer crashes on the phone: this runtime defines HTMLElement, and the bar's host ref matched it without addEventListener. The tap guard now attaches only to a DOM node. That fix is ec1cdb3. |
Prevents RN Web Pressable focus theft from collapsing the idle pill composer and unmounting the width toggle before onPress fires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # mobile/src/components/controls/MobileSegmentedControl.tsx
[Medium impact] The changes affect mobile chat usage displays and Duo session layouts, plus host-side usage state. Fix the covered composer meter and the two outstanding account-related findings before merging. Findings
SummaryAdds provider usage to the mobile chat composer.
|
Cursor's hashed identity was dropped, so every Cursor account shared one series. Open chats also follow the composer window and display settings.
# Conflicts: # mobile/src/session/MobileSessionContentRow.tsx
# Conflicts: # mobile/src/session/MobileSessionContentRow.tsx
# Conflicts: # mobile/src/i18n/locales/en.json
A cached snapshot blocked every later accounts.list on hosts that have no accounts stream.
persistMirrored resolves after the local write, so the revision guard was dropping before the shell echoed the latest choice.
Keep the Duo dock on the bottom edge while taking the phone key dock and the setup update notice.
…-meter Keep the composer meter beside the Duo width toggle, and the phone key dock on the bottom edge.
Keep the Duo session content, and read the renamed session toast.



Problem
Usage limits are what most often interrupts an agent session, and the phone shows them only on the Accounts screen.
What changes
6d 16h), centred in the chat composer's action row. The bar takes the window's pace colour — green on or under pace, amber ahead of it, red when the burn would run out before reset — and the countdown ticks at each label change. Hidden for agents with no mapped provider or no usage data.6d), then drops, before the meter hides.accounts.subscribestream per client, closed 2 s after the last composer leaves, with a one-shotaccounts.listfallback. It reusessubscribeAccountsSnapshots,getUsageWindowSections,getProviderDisplayName,getActiveProviderRateLimitsandgetOtherUsageProvidersinstead of its own copies.orca-usage-window-history.jsonand streams it asrateLimits.usageHistory. The graph shows a collecting placeholder until two readings exist.orca-usage-last-good.jsonand seed the rate-limit state at startup, so a failed first poll falls back through the stale policy instead of blanking the meter. Expired windows and readings older than 24 h are dropped on restore.server_sent_no_usageanswer (no turn yet in the window) reads as an unused five-hour window with a "no usage data yet" note instead of a failure.Changes since last update
How it relates to upstream
Builds on #38187 (provider usage windows on Accounts) and #38206 (Home Usage tab), reusing their window and snapshot code. The terminal composer was removed upstream (#37900), so the meter lives on the chat composer only.
Fixes #36745
Visual Proof
Real iPhone 17 Pro Max simulator screenshots of a scratch chat; not layout renders. No personal data in frame. Note: these show the previous meter design and predate this update.
The composer meter (7-day window) and the usage sheet with pace:
Testing
pnpm tc,pnpm -C mobile typecheck, the composer-usage vitest suites (38 tests), the rate-limits suites, and oxlint on the changed files pass.pnpm build:mobile-webpasses. The eager fence is 12,746,752 bytes and this branch measures 12,725,457.Installed on an iPhone Duo against a dev desktop (previous revision).
I manually tested these changes locally
Automated tests added/updated, or explained why not below
🤖 Generated with Claude Code