Skip to content

Add an account limit meter to the chat composer - #2155

Closed
Arimodu wants to merge 1 commit into
pingdotgg:mainfrom
Arimodu:t3code/remaining-limit-meter
Closed

Arimodu wants to merge 1 commit into
pingdotgg:mainfrom
Arimodu:t3code/remaining-limit-meter

Conversation

@Arimodu

@Arimodu Arimodu commented Apr 18, 2026 •

Copy link
Copy Markdown

What Changed

Added a small UI element using the same UI as the context remaining display (just using different color). With a hover tooltip for details
As it is now, this is codex-only. I didn't look into implementing into other harnesses because I don't have an active sub on those.

Why

This is a useful way to see the account limits at a glance (instead of having to open a terminal, run codex, type /status). Courtesy of @iPixelGalaxy for bullying me into using my codex subscription to make this

UI Changes

A table just to make this look nicer
Screenshot 2026-04-18 043527 Screenshot 2026-04-18 043604 Screenshot 2026-04-18 043630
Screenshot 2026-04-18 043651 Screenshot 2026-04-18 043704 Screenshot 2026-04-18 043729

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

Medium Risk
Adds a new cross-layer runtime event and normalization schema for account rate limits, plus new UI driven off activity ingestion; mistakes could cause missing/incorrect limits or extra event noise but does not touch auth or persistence.

Overview
Adds end-to-end support for displaying account rate limits in the chat composer.

On the server, Codex now proactively fetches account/rateLimits/read on session start and after turn/completed/account/updated, emitting account/rateLimits/updated; provider adapters (Codex + Claude) attach a new normalized snapshot to account.rate-limits.updated, and orchestration ingestion converts that into an account-rate-limits.updated thread activity.

On the web, introduces AccountLimitMeter and wires it into ChatComposer, deriving the latest limit snapshot from activities and hiding these activities from the work log.

Reviewed by Cursor Bugbot for commit 2b537c0. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add an account limit meter to the chat composer

  • Adds a circular meter UI (AccountLimitMeter.tsx) to the chat composer footer that displays current account rate-limit usage with a popover showing session/weekly reset windows.
  • Introduces a normalizeAccountRateLimits utility (packages/shared/src/accountLimits.ts) that parses provider-specific rate-limit payloads into a consistent AccountRateLimitsSnapshot, selecting the most constrained window.
  • Refreshes rate limits on session start, turn completion, and account/updated notifications via a new refreshRateLimits method in CodexAppServerManager.ts; failures are non-fatal and logged at debug level.
  • Both the Codex and Claude adapters now attach a normalized snapshot to account.rate-limits.updated runtime events, which the ingestion layer converts to account-rate-limits.updated activities.
  • Filters account-rate-limits.updated activities out of work log entries in session-logic.ts.

Macroscope summarized 2b537c0.

@coderabbitai

coderabbitai Bot commented Apr 18, 2026

Copy link
Copy Markdown

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: 77c843ff-f1b8-414a-b681-07213223c8ac

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

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 size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 18, 2026
@iPixelGalaxy

Copy link
Copy Markdown

name dropping me like that, smh

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2b537c0. Configure here.

Comment thread apps/web/src/components/chat/AccountLimitMeter.tsx
@macroscopeapp

macroscopeapp Bot commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (account limit meter) spanning backend adapters, contracts, shared utilities, and frontend components across 10 files. Additionally, an unresolved review comment identifies a medium-severity bug where the meter may display misleading information when the secondary rate limit window is more constrained than the primary.

You can customize Macroscope's approvability policy. Learn more.

Copy link
Copy Markdown
Member

This is an older account-usage meter implementation that overlaps active #1732 and the current rate-limit event plumbing. Consolidating on one implementation will avoid duplicate UI and protocol work.

This was closed as part of a large repo-wide maintenance sweep. If you think it's still relevant, please reopen.

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants