Skip to content

cmux NEXT composer: the usage ring can show your plan's 5-hour and weekly limits, picked from its right-click - #34775

Merged
teamleaderleo merged 9 commits into
feat-cmux-nextfrom
lane/plan-usage-ring-web
Nov 4, 2026
Merged

teamleaderleo merged 9 commits into
feat-cmux-nextfrom
lane/plan-usage-ring-web

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 2026-11-04: "are we able to disable the context thing on the bottom right? i want to be able to right click disable it. what's its name?" and "likewise, i guess we can turn that into a 5h/weekly usage type thing instead as well for some people. i suppose it'd be relevant sometimes for SOME people to have that surfaced e.g in their session info thing. see codex: [img] see claude: [img]"

References (Leo's screenshots):

  • Codex's ring popover: "Usage source: Your Pro plan / Weekly limit 10% left / Credits 56,766 credits / Manage usage".
  • Claude desktop's popover, opened from the ring next to the model chip: "Plan usage limits · Ultra See all → / 5-hour limit Resets at 10:00 PM 22% [bar] / Weekly · all models Resets Mon 3:00 PM 41% [bar]".

The ring's name is the usage ring (in code ContextRing). It is the circle at the end of the composer's quiet row.

What changed

  • Right-click the ring: it now shows Context Usage and Plan Usage as a checked choice, plus Hide Usage Ring. A right-click on the composer's button row shows a hidden ring again. Before this PR the ring had no right-click of its own.
  • Plan Usage mode (agentPane.composerRing = "planUsage"; the default stays "context"):
    • The ring draws the plan window closest to its cap.
    • Hovering or clicking the ring opens the plan usage popover. It shows each window's name, reset time ("Resets at 10:00 PM", "Resets Mon 3:00 PM") and percent used with a bar, plus Codex's credits.
    • See all → opens the account's usage page. It appears only for Claude and Codex chats, where the URL is known.
  • Only real numbers: the popover reads only what the harness already reports, through acpmux's usageLimits (Claude Code's rate_limit_event; Codex's account/rateLimits/updated arrives with acpmux: a Codex chat's plan usage limits (5-hour, weekly, credits) are its usageLimits, as a Claude chat's #34714). Until a limit has been reported the ring stays on the context, and the popover says "No plan usage reported yet". It never shows a made-up 0%.
  • Session Info: the Usage section lists Plan limits rows (window, percent and reset time, then credits) in both the web panel and the native panel.
  • Settings: the page reads composerRing from the host's composer value and writes it with pane.setComposerRing {ring}. The Swift side (schema descriptor, palette, CLI and MCP through the settings schema, and the request decoding) is cmux NEXT settings: agentPane.composerRing chooses context or plan usage for the composer ring #34732.
  • iOS parity: one row in cmux-next-ios/verify/parity-mac.md, state "missing", with the reason.

Variants (gallery agent-pane.plan-usage-card, experiment plan-usage-look)

  • claude-bars (shipped): Claude desktop's card. Each window's name, reset time and percent sit on one line with an accent bar under it, and See all → is at the top. A share reads at a glance, and the layout holds two or three windows plus credits without growing wide.
  • codex-rows: Codex's popover. It shows "Usage source: Your Pro plan" and the share left for each window, with no bars. It has no title when the harness names no plan (Claude never does).
  • compact: one line per window with a short inline bar and the reset time underneath. It is denser, but the bar is too short to read.

Other states in the gallery: claude-bars-near-cap (three windows, one at 96%), none-reported, ring-plan-hover and ring-menu (the right-click).

Tests

webviews/test/plan-usage-ring.test.tsx covers:

  • the normalizer: Codex's plan, credits and window length, and nothing reported coming back as nothing;
  • window names and reset labels;
  • the ring in plan mode (its label, and the popover's contents);
  • the ring staying on the context when nothing is reported;
  • all three looks;
  • the right-click menu writing pane.setComposerRing and pane.showContextUsage;
  • the host value parsing;
  • Session Info's Plan limits rows.

Red: 82cd522 (the test alone; the modules it imports don't exist). Green: the head, bun test test/plan-usage-ring.test.tsx 8 pass.

Observed / Not run

Changelog

  • Added: Right-click the composer's usage ring to show your plan's 5-hour and weekly usage limits instead of context, or to hide it; Session Info's Usage lists the plan limits too.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

The composer's usage ring at the end of the quiet row can now show your plan's 5-hour and weekly usage limits instead of the chat's context, switched from its new right-click menu, which also hides the ring.

  • The right-click offers Context Usage, Plan Usage, and Hide Usage Ring; the button row's right-click restores a hidden ring.
  • The right-click opens even before any usage is reported — the ring is drawn aria-disabled with an inert click, since WebKit gives a disabled button no contextmenu.
  • Plan usage opens a popover with each window's reset time and percent used, plus Codex's credits, drawing only what the harness reported; with nothing reported, the ring stays on the context.
  • Session Info's Usage adds Plan limits rows in both the web and native panels.
  • The agentPane.composerRing setting (default "context") is written through pane.setComposerRing; the popover layout is the plan-usage-look experiment with claude-bars shipped, plus codex-rows and compact alternatives.
  • The phone's parity doc lists plan usage as missing.

Written for commit d539e71. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 4 commits November 4, 2026 03:59
…ight-click; nothing reported is nothing

Red: no plan usage popover, no composerRing setting, no ring right-click
menu and no Plan limits rows in Session Info yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df
… limits when picked from its right-click

Leo, 2026-11-04: "are we able to disable the context thing on the bottom
right? i want to be able to right click disable it" and "i guess we can
turn that into a 5h/weekly usage type thing instead as well for some
people ... e.g in their session info thing".

- The ring's right-click: Context Usage / Plan Usage (checked) and Hide
  Usage Ring; the button row's right-click shows it again.
- agentPane.composerRing (context by default) rides the composer event and
  is written with pane.setComposerRing {ring}.
- In plan mode the ring draws the window closest to its cap and its card is
  the plan usage popover (PlanUsageCard.tsx), read only from acpmux's
  usageLimits (Claude's rate_limit_event, Codex's account/rateLimits). With
  nothing reported the ring stays on the context; never a 0%.
- Session Info's Usage lists Plan limits (web and native panel).
- Gallery agent-pane.plan-usage-card, experiment plan-usage-look with
  claude-bars (shipped), codex-rows and compact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 4, 2026
…format

Review of 0e7112e: a disabled <button> gets no contextmenu in WebKit, so
before the first usage report (or for a harness that never reports context)
the ring's right-click (Context / Plan usage / Hide) never opened. The ring
is now aria-disabled with an inert click, styled as before. Test: a
right-click on an inert ring opens the three items; a click shows no card.
Also formats the files the earlier commits left unformatted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df
@cursor

cursor Bot commented Nov 4, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent opus-5.5 medium): SHIP at 8698767

Visual verdict: unchanged by this diff for the inert ring. The new [aria-disabled="true"] selector carries the old :disabled styling exactly. The popover is new UI, shown in gallery agent-pane.plan-usage-card.

Checked:

  • An inert ring opens no card from a click, Enter/Space, hover, focus, Tab or the registerPicker path, and its right-click now opens.
  • The default context mode is unchanged.
  • A string usageLimits is guarded, plan mode with no windows falls back to context (never 0%), and credits alone fill no ring.
  • The menu's checked state, and Hide / Show again through chrome.all, work.
  • No per-token work, no CSS collisions, every string key is present, and the gallery entry is well formed.

Follow-ups:

Gallery coverage (test/gallery-coverage.test.ts) is red on base 851f9ed with the same three tests and the same 205 reported lines as this head, so that red is not this PR's.

…sage-ring-web

# Conflicts:
#	webviews/src/agent-session/acpmux/Localizable.xcstrings
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

780c6e6 only merges feat-cmux-next (540d12f) to clear a conflict in Localizable.xcstrings, where both sides added entries and both are kept. The PR's own change (git diff HEAD^2 HEAD) is line-for-line identical to the reviewed 8698767, so the SHIP above covers it. Locally, 57 of 57 pass across plan-usage-ring, ContextCard, hideable-chrome, session-info-usage and session-info-context-breakdown.

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review (next-review patch-id; carried, since=20261104T044117Z): SHIP at 780c6e6

The independent SHIP at 8698767 carries to this head: the PR's own change (git diff $(git merge-base feat-cmux-next HEAD) HEAD) has the same git patch-id --verbatim (d8aa3ac2d3d3f476) at both heads, and no merge between them was resolved by hand. A base merge's conflicts in webviews/src/agent-session/acpmux/Localizable.xcstrings were resolved by keeping both sides whole, and the PR's own lines there are the same at both heads; the patch-id leaves those files out. Nothing new to review. A newer BLOCK, or any change to the PR's own diff, ends the carry.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review d539e71: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr34775 -f ref=lane/plan-usage-ring-web -f platform=macos -f backend_mode=local

Stale: these images are of 780c6e6; the head is now d539e71 and a new capture is running.

Gallery before/after for 780c6e6: 16 states rendered, 4 images differ, 3480 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41773924136 -R manaflow-ai/cmux -n gallery-advisory-34775-780c6e63c25449c7d11a36e5125e7e32f4a2d7c1 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.access-offer/turn-no-credits Apple System Colors Light unchanged 0% own styles.css
agent-pane.access-offer/turn-no-credits Apple System Colors unchanged 0% own styles.css
agent-pane.access-offer/turn-low-credits Apple System Colors Light unchanged 0% own styles.css
agent-pane.access-offer/turn-low-credits Apple System Colors unchanged 0% own styles.css
agent-pane.access-offer/turn-no-offer Apple System Colors Light unchanged 0% own styles.css
agent-pane.access-offer/turn-no-offer Apple System Colors unchanged 0% own styles.css
agent-pane.activity-line-looks/none Apple System Colors Light unchanged 0% own styles.css
agent-pane.activity-line-looks/none Apple System Colors unchanged 0% own styles.css
agent-pane.activity-line-looks/spinner Apple System Colors Light changed 0.0522% own styles.css
agent-pane.activity-line-looks/spinner Apple System Colors changed 0.047% own styles.css
agent-pane.activity-line-looks/kind Apple System Colors Light changed 0.0265% own styles.css
agent-pane.activity-line-looks/kind Apple System Colors changed 0.0255% own styles.css
agent-pane.activity-line-looks/aligned Apple System Colors Light unchanged 0% own styles.css
agent-pane.activity-line-looks/aligned Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/environment Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/environment Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/sources Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/sources Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/directory Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/directory Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/long-directory Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/long-directory Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/keyboard Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/keyboard Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/browse-error Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/browse-error Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-list/page-failed Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-list/page-failed Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-list/page-recovered Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-list/page-recovered Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-list/long-values Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-list/long-values Apple System Colors unchanged 0% own styles.css

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

Passes: CI passes on d539e713c3.

CI passes on d539e713c3 (run 41784648617 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

Shipped in:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent opus-5.5 medium): SHIP at 21fe2ad

The delta since 780c6e6 fixes two of this PR's own lint reds. It drops a fixed wait in the new test: act flushes the click, so a card that wrongly opened would already be in the DOM. It also moves the bar height to var(--ds-space-1), which is 4px, and the gallery stage's min-height to a local custom property. The visuals are unchanged. The rest of the diff is the content already reviewed (SHIP at 8698767).
The CmuxMobileKit failure (CloudChatsLiveTests) is unrelated: this PR touches only a parity markdown file under iOS.

Follow-ups: assert aria-expanded="false" after the inert click in test/plan-usage-ring.test.tsx.

@blacksmith-sh

blacksmith-sh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp40pp1ttw/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpk8srkfoj/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…sage-ring-web

# Conflicts:
#	webviews/src/agent-session/acpmux/Localizable.xcstrings
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Carry of the SHIP at 21fe2ad to d539e71.

There are two changes since that head:

  • 54fb077 adds .acpmux-plan-usage-bar to agent-pane-no-capsules' list of shapes that are capsules by nature. It's a 4 px progress bar, listed like .acpmux-context-card-bar next to it. This fixes the PR's own webview red in that test.
  • d539e71 merges feat-cmux-next. The only conflict was Localizable.xcstrings, where both sides added keys at the top; both were kept, the JSON parses, and the PR still adds the same 27 keys.
    No product code changed since the review.

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review (gpt-6-astra): SHIP at d539e71

Review (codex gpt-6-astra high, router-review job 3b29331f6fd1f52e63698b983de33d3a): SHIP at d539e71
Visual verdict: no images; Leo tries the build

Source review completed; tests could not run because Bun and webview dependencies are unavailable.

  1. [P2] [follow-up] [category:correctness] [finding:F1] [outcome:pending] webviews/src/agent-session/acpmux/ComposerPickers.tsx:1622: Separate the selected popover mode from whether a plan fraction exists. planShown requires a reported window, so selecting Plan Usage without windows opens the context card—or nothing when context is also unknown. The promised “No plan usage reported yet” state is unreachable from the ring, and valid credits-only reports are hidden. Keep the context arc fallback, but render the plan popover when Plan Usage is selected; add ring interaction coverage for missing limits and credits-only reports.

  2. [P2] [follow-up] [category:ux] [finding:F2] [outcome:pending] webviews/src/agent-session/acpmux/PlanUsageCard.gallery.tsx:99: Supply after captures of the popover and right-click menu, including the narrow layout, so their rendered appearance can be checked against the references.

Follow-ups:

  • Separate plan popover selection from ring fraction availability and test both fallback states.
  • Capture and review the new gallery states.

@teamleaderleo
teamleaderleo merged commit d56ed7b into feat-cmux-next Nov 4, 2026
191 of 201 checks passed
@teamleaderleo
teamleaderleo deleted the lane/plan-usage-ring-web branch November 4, 2026 07:22
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Finding outcome: review-5764662520/F1 filed-follow-up #35050
Finding outcome: review-5764662520/F2 filed-follow-up #35051

teamleaderleo added a commit that referenced this pull request Nov 4, 2026
Base's #34775 moved the empty ring from disabled to aria-disabled so its right-click
menu still opens. bun test test/context-ring-gauge.test.tsx: 5 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df
teamleaderleo added a commit that referenced this pull request Nov 4, 2026
* test(composer): the context ring reads as a gauge, never a spinner (red)

Leo read the ring at 68% as a loading spinner. Pins a visible remaining-share
track and flat arc ends at 25/68/95%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df

* Composer: the context ring draws its remaining share as a visible track, never a spinner

Experiment context-ring-look (gallery agent-pane.context-ring, variants
gauge-25/68/95) compares track, arc (before), percent and fill-quiet; track ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df

* Composer: format the context ring files; its looks table sits above ContextRing's doc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df

* Composer: the context ring's circles and caption take no -ring class

composer-turn-cycle counts any [class*="-ring"] in the quiet row besides the
context wrapper and button as a spinner; the new track/used/caption classes
matched it. Renamed to acpmux-context-track/used/caption.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df

* Composer ring test: the empty ring is aria-disabled, its click inert

Base's #34775 moved the empty ring from disabled to aria-disabled so its right-click
menu still opens. bun test test/context-ring-gauge.test.tsx: 5 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9435bc58cd1ad61a49df

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — d539e713 Deployed Nov 4, 2026 by teamleaderleo via wait for same-key tree publisher #110049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant