Skip to content

feat: add weekly/session usage limit pill in sidebar#880

Open
adityavardhansharma wants to merge 4 commits intopingdotgg:mainfrom
adityavardhansharma:feat/weekly-session-limit
Open

feat: add weekly/session usage limit pill in sidebar#880
adityavardhansharma wants to merge 4 commits intopingdotgg:mainfrom
adityavardhansharma:feat/weekly-session-limit

Conversation

@adityavardhansharma
Copy link
Contributor

@adityavardhansharma adityavardhansharma commented Mar 11, 2026

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:

  • Free / Go / Plus — shows only the weekly usage bar (no session window available)
  • Pro and above — shows the 5-hour session usage bar by default, with an expandable chevron to reveal the weekly usage bar above it (smooth animated expand/collapse)

Server:

  • codexAppServerManager.ts — added fetchAndEmitRateLimits() that calls account/rateLimits/read on session start and after each completed turn
  • CodexAdapter.ts — fixed payload wrapping so the rate limits object passes through correctly
  • wsServer.ts — subscribed to account.rate-limits.updated events and broadcasts them to clients
  • packages/contracts/src/ws.ts — added providerRateLimitsUpdated channel

Web:

  • wsNativeApi.ts — added RateLimitWindow and RateLimitsPayload types, onRateLimitsUpdated listener, payload guard against null/non-object data
  • rateLimitsStore.ts — new store using useSyncExternalStore to expose rate limits to React
  • WeeklyLimitPill.tsx — new component with OpenAI logo, progress bar, percentage left, reset time on hover, and expandable session/weekly view for Pro+ users
  • Sidebar.tsx — renders the pill in the footer with a separator above Settings

Why

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

Screenshot 2026-03-09 111943

After — Free / Go Plans

Screenshot 2026-03-09 125955

After — Pro Plan and above (collapsed)

Screenshot 2026-03-09 123856

After — Pro and above (expanded)

Screenshot 2026-03-09 130053

VIdeo:

Recording.2026-03-09.130236.mp4

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add weekly/session usage limit pill to sidebar

  • Adds a WeeklyLimitPill component to the sidebar footer that displays the current rate limit status (session or weekly) with an expandable secondary window and a progress bar.
  • Introduces a rateLimitsStore React hook backed by useSyncExternalStore that subscribes to live rate limit updates pushed over WebSocket.
  • Extends the server to fetch and emit account/rateLimits/updated notifications on session start and after each turn completes, forwarding updates to clients on a new provider.rateLimitsUpdated WS channel.
  • Adds RateLimitWindow and RateLimitsPayload TypeScript types and the corresponding WS channel contract in ws.ts.

Macroscope summarized b5ecd58.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9f27a34a-c448-47e6-aa11-c9a16d1cb43c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 11, 2026
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
@paul-bouzian
Copy link

so cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants