feat: add weekly/session usage limit pill in sidebar#880
Open
adityavardhansharma wants to merge 4 commits intopingdotgg:mainfrom
Open
feat: add weekly/session usage limit pill in sidebar#880adityavardhansharma wants to merge 4 commits intopingdotgg:mainfrom
adityavardhansharma wants to merge 4 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
|
so cool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Added a "Weekly Usage" pill to the sidebar footer (above Settings) that shows Codex rate limits with the OpenAI logo. The pill adapts based on the user's plan:
Server:
codexAppServerManager.ts— addedfetchAndEmitRateLimits()that callsaccount/rateLimits/readon session start and after each completed turnCodexAdapter.ts— fixed payload wrapping so the rate limits object passes through correctlywsServer.ts— subscribed toaccount.rate-limits.updatedevents and broadcasts them to clientspackages/contracts/src/ws.ts— addedproviderRateLimitsUpdatedchannelWeb:
wsNativeApi.ts— addedRateLimitWindowandRateLimitsPayloadtypes,onRateLimitsUpdatedlistener, payload guard against null/non-object datarateLimitsStore.ts— new store usinguseSyncExternalStoreto expose rate limits to ReactWeeklyLimitPill.tsx— new component with OpenAI logo, progress bar, percentage left, reset time on hover, and expandable session/weekly view for Pro+ usersSidebar.tsx— renders the pill in the footer with a separator above SettingsWhy
Codex CLI shows weekly usage limits but the T3 Code GUI had no way to see them. This surfaces the same data from the Codex app-server without requiring users to check the CLI separately. The pill self-hides when no rate limit data is available, so it won't affect future providers like Claude Code or Open Code.
UI Changes
Before
After — Free / Go Plans
After — Pro Plan and above (collapsed)
After — Pro and above (expanded)
VIdeo:
Recording.2026-03-09.130236.mp4
Checklist
Note
Add weekly/session usage limit pill to sidebar
WeeklyLimitPillcomponent to the sidebar footer that displays the current rate limit status (session or weekly) with an expandable secondary window and a progress bar.rateLimitsStoreReact hook backed byuseSyncExternalStorethat subscribes to live rate limit updates pushed over WebSocket.account/rateLimits/updatednotifications on session start and after each turn completes, forwarding updates to clients on a newprovider.rateLimitsUpdatedWS channel.RateLimitWindowandRateLimitsPayloadTypeScript types and the corresponding WS channel contract in ws.ts.Macroscope summarized b5ecd58.