Skip to content

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

Merged
btsouth merged 4 commits into
mainfrom
cursor/mcp-cursor-strip-remaining-9823
Sep 7, 2026
Merged

btsouth merged 4 commits into
mainfrom
cursor/mcp-cursor-strip-remaining-9823

Conversation

@btsouth

@btsouth btsouth 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 Cursor remaining_percent with strip ranking via shared constraining window selector

  • Adds a shared constraining_rate_window selector in constraining.rs that dispatches Cursor entries to cursor_strip_window and all other providers to generic_constraining_window. Cursor ranking treats Auto, API, and on-demand as parallel actionable pools, surfacing on-demand after included lanes are exhausted or once it has spend, and falling back to Plan.
  • MCP get_status and the desktop taskbar strip now use the same provider-aware selector instead of the old local primary/secondary/tertiary ranking. The MCP-local constraining_rate_window, window_outranks, and reset_at_rank helpers are removed.
  • WidgetProviderEntry and MCP usage JSON now persist and serialize extra_rate_windows (Cursor API, on-demand, etc.) with id, title, rate fields, and optional amount data. Older snapshots deserialize with an empty extras list.
  • Behavioral Change: Cursor account selection now prefers the constraining Auto/API/on-demand window over Plan; non-Cursor providers retain exhausted-first primary ranking. WidgetProviderEntry gains a serde extra_rate_windows field that is omitted when empty but must be tolerated by out-of-tree readers parsing the snapshot JSON.

Macroscope summarized 3c84609.

Summary by CodeRabbit

  • New Features

    • MCP usage and status data now include additional quota windows for supported providers.
    • Cursor usage status now considers Auto, API, and on-demand windows when selecting the most constrained account.
    • Additional quota-window information is preserved in desktop usage snapshots.
  • Bug Fixes

    • Improved account selection when Cursor plan and usage windows have different utilization levels.
  • Documentation

    • Updated MCP documentation to describe expanded usage data and Cursor-specific quota selection.

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

Review Change Stack

Warning

Review limit reached

Next included review available in 41 minutes.

Check out review usage here.

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: Team

Run ID: 60ae95ee-1b77-4b98-a6c7-42c399bf3628

📥 Commits

Reviewing files that changed from the base of the PR and between 0de1d65 and 3c84609.

📒 Files selected for processing (1)
  • apps/desktop-tauri/src-tauri/src/commands/providers.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 605bbe22-7569-4e84-af93-9c5c129dc6e3

📥 Commits

Reviewing files that changed from the base of the PR and between c9e3d43 and 0de1d65.

📒 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

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds shared constraining-window ranking for Claude, Codex, and Cursor. Cursor extra windows are persisted and exposed through MCP. Desktop seat selection and MCP status now use the same ranking rules.

Changes

Cursor quota-window ranking

Layer / File(s) Summary
Provider-specific ranking engine
rust/src/core/constraining.rs, rust/src/core/mod.rs
Adds shared generic and Cursor-specific constraining-window selection with exhausted, usage, and reset-time ordering.
Snapshot persistence and seat selection
rust/src/core/widget_snapshot.rs, apps/desktop-tauri/src-tauri/src/commands/providers.rs, apps/desktop-tauri/src-tauri/src/commands/tests.rs
Persists labeled Cursor extra windows, converts snapshot windows into widget entries, and ranks seats by the selected constraining window.
MCP usage and status integration
rust/src/cli/mcp.rs, rust/src/cli/statusline.rs, docs/CLI.md, CHANGELOG.md
Serializes extra windows, uses shared ranking for status values, updates test fixtures, and documents Cursor-specific quota selection.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 0de1d

Cursor usage windows are persisted and consistently selected for desktop and MCP status output, with no remaining actionable merge risk identified.

Suggested reviewers: finesssee

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 62 functions across 7 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: aligning MCP Cursor remaining_percent with the desktop strip ranking. It is concise and specific.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 56.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 62 functions across 7 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/mcp-cursor-strip-remaining-9823

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 3c84609 Commit Preview URL

Branch Preview URL
Sep 07 2026, 05:54 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>
@btsouth
btsouth 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)

Comment thread apps/desktop-tauri/src-tauri/src/commands/providers.rs Fixed
@btsouth
btsouth merged commit 12b55ce into main Sep 7, 2026
10 of 11 checks passed
@btsouth
btsouth deleted the cursor/mcp-cursor-strip-remaining-9823 branch September 7, 2026 18:00
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.

3 participants