Skip to content

Align MCP Cursor remaining_percent with strip ranking (SBS-1076) - #408

Open
tsouth89 wants to merge 2 commits into
mainfrom
cursor/mcp-cursor-strip-remaining-9823
Open

Align MCP Cursor remaining_percent with strip ranking (SBS-1076)#408
tsouth89 wants to merge 2 commits into
mainfrom
cursor/mcp-cursor-strip-remaining-9823

Conversation

@tsouth89

@tsouth89 tsouth89 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

MCP get_status.remaining_percent after SBS-1055 / #383 used generic window_outranks over primary/secondary/tertiary. That is correct for Claude/Codex, but Cursor’s strip uses cursorStripWindow: Auto and API are parallel pools, so a hotter Plan must not hide Auto, and a maxed API must not hide Auto that still has room. The widget snapshot also still omitted cursor-api / cursor-on-demand while CLI.md claimed strip parity.

This change:

  • Persists extra_rate_windows on widget-snapshot.json (including Cursor API and on-demand amounts).
  • Ranks MCP remaining_percent with the same cursorStripWindow rules as the desktop strip.
  • Picks the Cursor multi-account seat by that same window, not Plan used %.
  • Exposes extras on get_usage / get_status.usage.
  • Corrects the docs/changelog claims that remaining_percent already matched the strip.

Related issue

Fixes SBS-1076 (follow-up to SBS-1055 / #383).

Affected areas

  • Tray panel
  • Settings UI
  • Config file / settings persistence
  • CLI (codexbar mcp get_status / get_usage)
  • Provider-specific behavior (Cursor ranking + extras)
  • Installer / release packaging
  • Startup / background behavior
  • Documentation
  • Other: widget snapshot persist + multi-account seat picker

Validation

  • powershell.exe -ExecutionPolicy Bypass -NoProfile -File scripts\local-check.ps1 (Windows host script; not run here)
  • Other:
    • TDD proof: forcing generic ranking (the Make MCP get_status remaining_percent use constraining window (SBS-1055) #383 path) failed 7 Cursor tests, e.g. Plan 95% / Auto 55% bound remaining_percent 5 instead of 45; Auto 100% / API 40% bound 0 instead of 60.
    • cargo test --manifest-path rust/Cargo.toml — 1202 lib + 32 bin passed
    • cargo fmt --all --check on both manifests — clean
    • Hosted CI on c160c56 — 10/10 checks passed (Frontend, Rust/shared, Rust/desktop, Rust required, CodeQL)
    • First desktop revision failed one persist test that mixed on-demand spend with an Auto-has-room assertion (spend binds first). Fixed in c160c56.

UI / tray proof

  • Not applicable (MCP / snapshot ranking; no visual change)

Notes for reviewers

Do not merge until review.

Open in Web Open in Cursor 

Note

Align MCP get_status remaining_percent with desktop strip ranking for Cursor

  • Adds a shared core::constraining_rate_window that delegates to cursor_strip_window for Cursor and generic_constraining_window for other providers, so ranking logic lives in one place
  • Cursor ranking prefers actionable lanes with room (Auto/API) over Plan, surfaces on-demand when active, and falls back to Plan when neither actionable nor on-demand is active
  • WidgetProviderEntry gains extra_rate_windows: Vec<NamedRateWindow> (e.g. cursor-api, cursor-on-demand) so snapshots and MCP usage payloads carry the lanes needed for strip-consistent ranking
  • MCP CeilingMcp.get_status now derives remaining_percent from WidgetProviderEntry::constraining_rate_window instead of local ranking helpers, which are removed
  • Seat picker (most_constrained_per_provider) and widget_entry_from_usage_snapshot now use snapshot_constraint_used_percent to match the desktop strip
  • Behavioral Change: get_status ranking for Cursor now considers Auto/API/on-demand lanes instead of Plan alone; get_usage payloads now include extra_rate_windows; legacy snapshots without extra_rate_windows still deserialize with an empty list

Macroscope summarized c160c56.

MCP get_status used generic exhausted-first ranking and dropped
cursor-api / on-demand from the widget snapshot, so Plan could hide
Auto and docs claiming strip parity were wrong. Rank Cursor with
cursorStripWindow and persist the same extras the strip uses.

Co-authored-by: Tyler <tyler@southboundsoftware.com>
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 40 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 66cc4fc0-16c3-4123-a5f9-afeca52720d9

📥 Commits

Reviewing files that changed from the base of the PR and between 5bae231 and c160c56.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • apps/desktop-tauri/src-tauri/src/commands/providers.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs
  • docs/CLI.md
  • rust/src/cli/mcp.rs
  • rust/src/cli/statusline.rs
  • rust/src/core/constraining.rs
  • rust/src/core/mod.rs
  • rust/src/core/widget_snapshot.rs

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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling c160c56 Commit Preview URL

Branch Preview URL
Aug 23 2026, 10:34 PM

On-demand spend binds the strip even when Auto still has room.
Assert that, and keep unused on-demand as the Plan-must-not-win case.

Co-authored-by: Tyler <tyler@southboundsoftware.com>
@tsouth89
tsouth89 marked this pull request as ready for review August 23, 2026 22:39
@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_48aef84c-3ec9-4666-8347-72942785fc68)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants