Repository navigation
Conversation
There was a problem hiding this comment.
Important
The Cursor segment is gated behind cursor-agent CLI detection, but Cursor auth is desktop-primary — desktop-only users will never see the bar.
Reviewed changes
cursorrate-limit provider — reads the desktopstate.vscdbtoken read-only (cursor-agentauth.jsonas fallback), fetchescursor.com/api/usage-summary+api2.cursor.shsand usage, and mapsCursor Models/Other Models/On-demand/Grok Botbuckets into the sharedbucketsmodel.- Status bar — Cursor segment, visibility toggle, tooltip identity (email / plan / subscription) and per-pool meters, plus a default-on migration refactor (
ui-status-bar-default-migration.ts) that also addscursor. - Settings → Accounts — read-only
CursorAccountsSectionwith identity, pool meters, Refresh, and docs/spending links, plus search entries. - Mobile — read-only Cursor card on the paired-host Accounts screen; snapshot decoder tolerates an absent
cursorslot. - Shared —
cursoradded to provider union,RateLimitState, status-bar items/defaults, RPCStatusBarItemenum, andRateLimitBucket.windowMinutesmade optional.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 4042ed2a251e92b19c15e00b23d048119f5efd80 and 7e3c6f4. 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThis change adds Cursor as a rate-limit provider. It reads desktop and CLI authentication, fetches and maps Cursor usage pools, and integrates Cursor into rate-limit service state. Desktop settings, status-bar views, mobile accounts, localization, persistence migration, runtime capability filtering, mock data, and tests now support Cursor usage. Shared rate-limit types also support named buckets without required cycle durations. A timeout helper is shared with the Grok fetcher. Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (3)
src/renderer/src/components/settings/accounts-search.ts (1)
217-220: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftUse intent-named IDs for the new search strings.
The new
translatecalls use hash-based IDs. Use intent-named IDs and matching locale entries for this new catalog entry.Based on learnings: For newly added user-facing strings in stablyai/orca TypeScript and TSX files, follow config/i18n-translation-source.md: use intent-named localization IDs with named interpolation placeholders. Treat existing hash-based IDs as grandfathered, and do not require SHA-1-derived IDs for new strings.
Also applies to: 223-228
Source: Learnings
mobile/src/accounts/cursor-host-usage-section.tsx (1)
39-46: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy liftLocalize the new Cursor account strings.
Host Cursor login,Uses Cursor on the host, and theResets ...prefix are hardcoded. Non-English users will see English text in the new section. Use intent-named translation IDs and a named interpolation placeholder forbucket.resetDescription.Based on learnings: For newly added user-facing strings in stablyai/orca TypeScript and TSX files, follow config/i18n-translation-source.md: use intent-named localization IDs with named interpolation placeholders. Treat existing hash-based IDs as grandfathered, and do not require SHA-1-derived IDs for new strings.
Also applies to: 60-60
Source: Learnings
src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts (1)
14-16: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftUse intent-named localization IDs for new Cursor strings. The new Cursor strings in both files use hash-based IDs, but the current renderer localization workflow requires intent-named IDs for new user-facing TypeScript and TSX strings.
src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts#L14-L16: rename the Cursor title key and update locale catalogs.src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts#L18-L20: rename the Cursor description key and update locale catalogs.src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts#L40-L42: rename the Cursor toggle-description key and update locale catalogs.src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx#L145-L147: rename the Cursor menu-label key and update locale catalogs.Based on learnings: “For newly added user-facing strings in TypeScript and TSX files, use intent-named localization IDs. Treat existing hash-based IDs as grandfathered.”
Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 05e2791e-8741-4b4c-a608-a1829e196ad9
📥 Commits
Reviewing files that changed from the base of the PR and between 4bc20cb and a396835be9bc8ae18229faa8ee34cdb43ef96f9a.
📒 Files selected for processing (75)
mobile/app/h/[hostId]/accounts.tsxmobile/scripts/mock-server-account-state.tsmobile/scripts/mock-server-cursor-state.tsmobile/src/accounts-route-cursor.test.tsmobile/src/accounts-route-reset-credit.test.tsmobile/src/accounts/cursor-host-usage-section.tsxmobile/src/components/AccountUsage.tsxmobile/src/components/account-usage-state.test.tsmobile/src/components/account-usage-state.tsmobile/src/components/accounts-snapshot.test.tsmobile/src/components/accounts-snapshot.tsmobile/src/mock-server-account-state.test.tssrc/main/codex-accounts/service-reset-credit-test-fixtures.tssrc/main/rate-limits/cursor-auth.test.tssrc/main/rate-limits/cursor-auth.tssrc/main/rate-limits/cursor-fetcher.test.tssrc/main/rate-limits/cursor-fetcher.tssrc/main/rate-limits/cursor-usage-mapping.tssrc/main/rate-limits/gemini-bucket-formatting.tssrc/main/rate-limits/grok-fetcher.tssrc/main/rate-limits/rate-limit-request-timeout.tssrc/main/rate-limits/rate-limit-service-test-harness.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/rate-limits/service-antigravity-usage.test.tssrc/main/rate-limits/service-inactive-account-previews.test.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/main/rate-limits/service-minimax-usage.test.tssrc/main/rate-limits/service-refresh-orchestration.test.tssrc/main/rate-limits/service-window-activation.test.tssrc/main/rate-limits/service/service-configuration.tssrc/main/rate-limits/service/service-full-cycle-application.tssrc/main/rate-limits/service/service-full-cycle-preparation.tssrc/main/rate-limits/service/service-polling.tssrc/main/rate-limits/service/service-result-policy.tssrc/main/rate-limits/service/service-settled-provider-result.tssrc/main/rate-limits/service/service-state.tssrc/main/rate-limits/service/service-types.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/CursorAccountsSection.test.tsxsrc/renderer/src/components/settings/CursorAccountsSection.tsxsrc/renderer/src/components/settings/accounts-search.test.tssrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-minimax-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-search.tssrc/renderer/src/components/stats/GrokUsagePane.test.tsxsrc/renderer/src/components/status-bar/StatusBarProviderSegment.tsxsrc/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsxsrc/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsxsrc/renderer/src/components/status-bar/status-bar-agent-gating.test.tssrc/renderer/src/components/status-bar/status-bar-agent-gating.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.tssrc/renderer/src/components/status-bar/tooltip.test.tssrc/renderer/src/components/status-bar/tooltip.tsxsrc/renderer/src/components/status-bar/usage-error-copy.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.test.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/rate-limits.tssrc/renderer/src/store/slices/ui-hydration-workspace-preferences.test.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-actions.tssrc/renderer/src/store/slices/ui/ui-status-bar-default-migration.tssrc/renderer/src/web/preload-api/web-rate-limits-api.tssrc/shared/persisted-ui-state-types.tssrc/shared/rate-limit-types.test.tssrc/shared/rate-limit-types.tssrc/shared/status-bar-defaults.tssrc/shared/ui-chrome-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Addressed the three nitpicks from the CodeRabbit review as well: every new renderer string on this PR now uses an intent-named ID ( |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior pullfrog review at a396835)
- Ungated the Cursor segment from CLI detection — removed
cursorfromCLI_GATED_ITEMSand switched the segment, Appearance toggle, and visibility-menu item to credential/usage-driven gating via a newisCursorStatusBarAvailable(provider, cursorAuthConfigured)instatus-bar-provider-visibility.ts. This resolves the prior IMPORTANT finding: a desktop-only Cursor login now renders the bar/toggle withoutcursor-agenton PATH. - Added remote-wire capability negotiation — introduced
status-bar.cursor-item.v1(STATUS_BAR_CURSOR_ITEM_RUNTIME_CAPABILITY) and had the paired web client (web-ui-api.tsprepareHostUiUpdates) stripcursorfromui.setstatus-bar payloads sent to hosts that don't advertise it, so an older host'sStatusBarItemenum never sees the new value. Only the web client negotiates; native desktop renderer/main stay in lockstep. - Renamed locale IDs to intent-named — replaced the hash-based Cursor string IDs (
dd3e96043c,5d095e229c, …) with intent-named IDs across all five catalogs and their call sites, addressing the localization-ID feedback. - Fixed mobile meter alignment —
AccountUsage.tsxnow aligns the reset countdown to a customlabelWidthviaeffectiveLabelWidth, with a new layout test. - Made the
cursor-authEACCES test portable — swappedchmod(0)for areadFileSyncmock throwingEACCES, which behaves correctly on Windows.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
05e8db1 to
4bbf650
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — this run reviewed the branch after a rebase onto the latest main (base moved 28214e1 → 83b1558). The PR's own seven commits are unchanged in content (same commit subjects, new SHAs); the only delta is main's concurrent edits to files the PR also touches.
- Rebased onto latest
main— the rebase pulled inmain's concurrent changes to shared rate-limit and status-bar files (MiniMax fetcher split, ports segment rework, clipboard thumbnail, markdown-file opens), which merged cleanly with no conflict markers (working tree clean, no<<<<<<</=======markers). - Verified the
cursorintegration survives the rebase — confirmed the merged state of every shared file both sides modified still wirescursorcorrectly:service-types.ts(InternalRateLimitState.cursor),service-configuration.ts(cursorAuthConfigured),rate-limit-types.ts/rate-limit-state-factory.ts(provider union + empty state),status-bar-provider-visibility.ts(isCursorStatusBarAvailable),use-status-bar-controller.ts/use-available-status-bar-toggles.ts(credential-driven gating),usage-error-copy.ts(sign-in copy),protocol-version.ts(status-bar.cursor-item.v1), andweb-ui-api.ts(prepareHostUiUpdates). A diff of the old head05e8db14ffvs the new head4bbf650acdrestricted to Cursor-specific files is empty apart from unrelatedweb-ui-api.tsclipboard/markdown additions pulled frommain.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Thanks for landing this — exactly the gap I’m hitting as a daily Cursor + Orca user on macOS. Happy to help get it over the line:
No pressure either way — just wanted to offer hands if a macOS smoke pass or a fresh rebase would unblock review/merge. Happy to report back with before/after notes once there’s a rebased head to try. |
4bbf650 to
4042ed2
Compare
|
@jairuspace thanks — this was exactly the gap. Rebased onto current macOS screenshots are in the PR description under macOS live proof. The desktop path now has an isolated unit test plus an opt-in Electron spec ( Happy to take another pass if you hit anything on your machine. |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a74d9716-7bbb-40c4-a439-5bcfb385b2c9
📥 Commits
Reviewing files that changed from the base of the PR and between 4bbf650acde70ba74245592041e908d5e9a52766 and 4042ed2a251e92b19c15e00b23d048119f5efd80.
📒 Files selected for processing (18)
src/main/rate-limits/cursor-auth.test.tssrc/main/rate-limits/cursor-auth.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/runtime/rpc/methods/client-ui.test.tssrc/renderer/src/components/settings/CursorAccountsSection.tsxsrc/renderer/src/components/settings/accounts-search.test.tssrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/ui-hydration-workspace-preferences.test.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-actions.tssrc/shared/persisted-ui-state-types.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/client-ui-params.tstests/e2e/cursor-usage-macos-desktop-login.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/ko.json
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| if (desktopRead.status === 'error') { | ||
| return desktopRead | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Try Cursor Agent auth after a desktop-read failure.
If state.vscdb is locked or corrupt, this return prevents reading a valid Cursor Agent auth.json. The provider then reports a desktop auth error instead of available usage from its other supported credential source. Try CLI auth before returning the desktop error, and preserve the desktop error only if no usable CLI session exists.
| async function maskCursorEmail(page: Page): Promise<void> { | ||
| await page.evaluate(() => { | ||
| const current = window.__store!.getState().rateLimits | ||
| const cursor = current.cursor | ||
| if (!cursor?.usageMetadata?.accountEmail) { | ||
| return | ||
| } | ||
| window.__store!.setState({ | ||
| rateLimits: { | ||
| ...current, | ||
| cursor: { | ||
| ...cursor, | ||
| usageMetadata: { | ||
| ...cursor.usageMetadata, | ||
| accountEmail: 'user@******.com' | ||
| } | ||
| } | ||
| } | ||
| }) | ||
| }) | ||
| } |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,180p' tests/e2e/cursor-usage-macos-desktop-login.spec.ts
rg -n -C 3 'rateLimits|cursorAuthConfigured|setState|poll|refreshRateLimits|email' tests/e2e src/renderer/src src/main/rate-limitsRepository: stablyai/orca
Length of output: 45546
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- target test ---'
cat -n tests/e2e/cursor-usage-macos-desktop-login.spec.ts
printf '%s\n' '--- candidate rate-limit files ---'
rg --files src/main/rate-limits src/renderer/src tests/e2e | rg -i '(rate.limit|cursor|usage|screenshot|proof)'
printf '%s\n' '--- narrow symbol search ---'
rg -n -C 4 --glob '!**/*.test.*' --glob '!**/node_modules/**' \
'refreshRateLimits|rateLimits|cursorAuthConfigured|usageMetadata|accountEmail|captureScreenshot|screenshot' \
src/main/rate-limits src/renderer/src tests/e2e/cursor-usage-macos-desktop-login.spec.tsRepository: stablyai/orca
Length of output: 43050
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- renderer rate-limit slice ---'
cat -n src/renderer/src/store/slices/rate-limits.ts | sed -n '19,42p;130,140p'
printf '%s\n' '--- polling and service update symbols ---'
rg -n -C 5 --glob '!**/*.test.*' \
'setRateLimitsFromPush|rateLimits.*push|push.*rateLimits|emit.*rate|on.*rate|poll|setInterval|refresh\(' \
src/main/rate-limits/service src/main/rate-limits/service.ts \
src/renderer/src/hooks/ipc-events/rate-limit-ipc-bridge.ts \
src/main | head -n 320
printf '%s\n' '--- bridge ---'
cat -n src/renderer/src/hooks/ipc-events/rate-limit-ipc-bridge.ts
printf '%s\n' '--- polling implementation ---'
cat -n src/main/rate-limits/service/service-polling.tsRepository: stablyai/orca
Length of output: 38809
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- service lifecycle and publication ---'
cat -n src/main/rate-limits/service/service-state.ts | sed -n '1,190p'
printf '%s\n' '--- fetch cycle state application ---'
rg -n -C 5 --glob '!**/*.test.*' \
'updateState\(|fetchAll\(|this\.state|publish|webContents\.send' \
src/main/rate-limits/service/service-fetch-queue.ts \
src/main/rate-limits/service/service-full-cycle-application.ts \
src/main/rate-limits/service/service-full-cycle-preparation.ts \
src/main/rate-limits/service/service-provider-cycles.ts \
src/main/rate-limits/service/service-configuration.ts
printf '%s\n' '--- Cursor successful result ---'
cat -n src/main/rate-limits/cursor-fetcher.ts | sed -n '55,170p'
printf '%s\n' '--- Cursor mapping metadata ---'
cat -n src/main/rate-limits/cursor-usage-mapping.ts | sed -n '1,220p'Repository: stablyai/orca
Length of output: 36288
Keep the Cursor email masked for the entire screenshot capture. maskCursorEmail changes only the renderer snapshot. A later focused-window rate-limit poll replaces that snapshot with a fresh Cursor result containing the real session.email. A subsequent proof screenshot can then expose the email. Apply the mask to every pushed snapshot, or pause polling until all screenshots complete.
| return { | ||
| auth: window.__store!.getState().rateLimits.cursorAuthConfigured, | ||
| status: cursor?.status ?? null, | ||
| bucketCount: cursor?.buckets?.length ?? 0 | ||
| } | ||
| }), | ||
| { timeout: 30_000 } | ||
| ) | ||
| .toEqual(expect.objectContaining({ auth: true, status: 'ok' })) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert bucketCount, or remove it from the polled payload.
The poll builds bucketCount, but expect.objectContaining({ auth: true, status: 'ok' }) never checks it. A provider result with status: 'ok' and zero buckets passes the gate. The spec then captures proof screenshots of an empty usage chip, which defeats the purpose of the proof run.
♻️ Assert a non-empty bucket list before capturing proof
- .toEqual(expect.objectContaining({ auth: true, status: 'ok' }))
+ .toEqual(expect.objectContaining({ auth: true, status: 'ok' }))
+ const bucketCount = await orcaPage.evaluate(
+ () => window.__store!.getState().rateLimits.cursor?.buckets?.length ?? 0
+ )
+ expect(bucketCount).toBeGreaterThan(0)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return { | |
| auth: window.__store!.getState().rateLimits.cursorAuthConfigured, | |
| status: cursor?.status ?? null, | |
| bucketCount: cursor?.buckets?.length ?? 0 | |
| } | |
| }), | |
| { timeout: 30_000 } | |
| ) | |
| .toEqual(expect.objectContaining({ auth: true, status: 'ok' })) | |
| return { | |
| auth: window.__store!.getState().rateLimits.cursorAuthConfigured, | |
| status: cursor?.status ?? null, | |
| bucketCount: cursor?.buckets?.length ?? 0 | |
| } | |
| }), | |
| { timeout: 30_000 } | |
| ) | |
| .toEqual(expect.objectContaining({ auth: true, status: 'ok' })) | |
| const bucketCount = await orcaPage.evaluate( | |
| () => window.__store!.getState().rateLimits.cursor?.buckets?.length ?? 0 | |
| ) | |
| expect(bucketCount).toBeGreaterThan(0) |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior pullfrog review at 4bbf650)
- Restored the Cursor default-on marker on the wire — re-added
_cursorStatusBarDefaultAddedto the sharedclient-ui-params.tsUiUpdateFieldsaftermainmoved the status-bar schema out ofclient-ui-schemas.ts. This fixes the persisted-key parity assertion that the rebase broke, and keeps the default-on migration able to send the marker. - Isolated the auth tests from a live macOS login — new
isolateLinuxCursorConfig/isolateDarwinCursorHomehelpers mockprocess.platformandos.homedir;cursor-auth.tsnow imports theosnamespace instead of the namedhomedir, so the unit tests no longer read the developer's realstate.vscdb. - Covered the macOS desktop store — added a unit test that builds a
~/Library/Application Support/Cursor/.../state.vscdb, pointsos.homedirat it, and asserts the desktop-primary session read. - Added an opt-in macOS Electron proof spec —
tests/e2e/cursor-usage-macos-desktop-login.spec.tsis skipped unlessdarwin,ORCA_CURSOR_USAGE_PROOF_DIR, and a real desktop DB are all present; it masks the account email before capture. - Two small
CursorAccountsSectionstyle fixes — movedtabular-numsfrom theBadgeclass onto an inner span and dropped a redundant buttongap-1.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…y provider Move the existing MiniMax search entry and default-on migration into focused modules. This keeps later provider additions below the max-lines ratchet without changing behavior.
Read existing Cursor desktop or CLI credentials without copying state. Fetch billing and Grok Bot pools with abort-aware polling and stale-state handling.
Add default-on, CLI-gated Cursor usage to the consolidated status bar. Render all named pools and signed-in account metadata with localized controls.
Show read-only Cursor sign-in identity, plan, and named usage pools. Register localized Accounts search entries and cover signed-out, pool, and error states.
Decode optional Cursor snapshots from mixed-version hosts and render named pools read-only. Add bucket helpers, a Cursor-only route test, and an extracted mock fixture.
Gate Cursor surfaces by credential or usage state and filter unsupported web UI writes by host capability. Align mobile reset labels with custom widths and make unreadable-auth coverage deterministic.
Rename every Cursor renderer key introduced by this branch while preserving all five translated catalog values. Keep search metadata and status-bar copy aligned with the maintainer naming policy.
Main moved the status-bar schema into shared UI params, so add the Cursor default-on marker there. Isolate auth tests from a live macOS desktop login, cover Application Support state.vscdb, and add an opt-in Electron proof spec for that path.
Keep a usable CLI session when state.vscdb is locked or corrupt, hold the masked Cursor email across proof screenshots, and require a non-empty usage bucket list before capturing those screenshots.
4042ed2 to
7e3c6f4
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta against the prior pullfrog review at 4042ed2)
- Added a CLI fallback when the desktop read fails —
readCursorAuthSession()now runs the Cursor Agentauth.jsonpath whenreadDesktopProfile()errors, returning the CLI session when it is usable and still surfacing the desktop error otherwise. - Extracted
readCliSession()— shared by the desktop-missing and desktop-error paths, so the token-to-session mapping is no longer duplicated. - Covered the new fallback — the added test builds a corrupt
state.vscdbalongside a validauth.jsonand asserts the CLI session with an exacttoEqual; the existing corrupt-DB test still asserts the desktop error when no CLI file exists, so the branch is genuinely exercised. - Hardened the macOS proof spec's email mask —
installPersistentCursorEmailMasksubscribes to the store so snapshots taken after a later host refresh stay masked, and the spec now asserts at least one usage bucket was fetched.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Thanks — confirmed on my machine as well. Setup: Results:
Looks good from here — happy to re-check once this lands or if you want another pass after further review feedback. |
|
Small naming nit from trying this against a live Cursor Pro login: Cursor’s own Would it be better to match
That way Orca and cursor.com/dashboard/usage use the same words when you’re comparing remaining allowance. Happy either way — just noticed the mismatch while smoke-testing. (Unrelated to this: Grok Bot as a fourth optional pool still seems right; |
|
Heads up — I've opened #22633, which brings Cursor usage tracking together from this PR and the other open attempts (#8669, #11780, #13837, #16815, #18119, #20469, #21833). You're credited as a co-author on the commit; your work is in there. The one thing I changed structurally: none of the open PRs read the macOS Keychain, and that's where Could you try it on your account and tell me if the numbers are right? There's an installable build here: macOS is signed and notarized, so it installs through Orca's updater. Windows is unsigned — grab What I'd love checked, since I couldn't: the live numbers on a working paid plan. The only Cursor account on this machine has an expired token, so I verified the credential discovery and every error path end-to-end, but never saw real percentages render. If the pools (Cursor Models / Other Models / On-demand) and the plan total match what cursor.com/dashboard shows you, that's the confirmation I'm missing. If they don't, tell me what you see versus the dashboard and I'll fix it. Also useful if you're on a plan shape I couldn't test: unlimited/Ultra, on-demand enabled, teams, or the older request-quota billing. |
|
Update: new build, please use this one instead — The build I linked earlier has been deleted, because review found three bugs in it that would have hit you directly:
Same ask as before, and the same one thing I still can't verify myself: do the numbers match your cursor.com dashboard? Install instructions are unchanged — macOS through Orca's updater, Windows via |
|
@nwparker |




ELI5
If you use Cursor as one of your agents, Orca now shows how much of your Cursor subscription you have used this month, right next to the Claude, Codex, and Grok meters, and in Settings → Accounts. It reads the login Cursor already has on this machine; it never changes it.
What Changed
refactor(status-bar)splits the appearance search entries and the status-bar default-on migration by provider; both upstream files were already at the 300-line ratchet.cursorrate-limit provider (commit 2): reads the Cursor desktop session token fromstate.vscdb(SQLite, read-only, in place, never copied) with the cursor-agentauth.jsonas fallback; per-platform roots (~/Library/Application Support,%APPDATA%,${XDG_CONFIG_HOME:-~/.config}, XDG on Linux only). FetchesGET https://cursor.com/api/usage-summary(session cookie) andPOST https://api2.cursor.sh/aiserver.v1.DashboardService/GetSandUsageStatus(Bearer) and maps them to the monthly pools: Cursor Models, Other Models, On-demand when present, and the separate Grok Bot pool. Wired into the existing split rate-limit service cycle with cancellation; no provider-specific queue.resetsAt, error copy that distinguishes not-configured, sign-in-required, and refresh-failed; default-on migration for the new status-bar item.cursorslot.RUNTIME_PROTOCOL_VERSIONchange.Why
Cursor billing has two monthly pools that are easy to exhaust during long agent runs, and today the only way to check is cursor.com/dashboard. Orca already shows live usage for every other agent it launches; #15516 asks for Cursor to join that set, read-only against the existing login, in the status bar and Accounts pane only. The pools are modelled as
bucketsrather than the single optionalmonthlywindow the issue mentions: Cursor Models and Other Models are two independent monthly quotas that cannot be expressed as one window. They are never averaged, no 0% is fabricated when a pool is absent, and a failure of the optional Grok Bot request never discards the billing pools.Linked Issue
Fixes #15516
Visual Proof
Captured on Linux with the repository's Playwright Electron fixture against a live Cursor Ultra login (cursor-agent
auth.json); the account email is masked. Mobile is covered by tests only (no paired device available for capture).macOS live proof (2026-09-21)
Rebased onto current
mainand exercised on a Mac against a live Cursor Ultra desktop login (~/Library/Application Support/Cursor/User/globalStorage/state.vscdb). Nocursor-agenton PATH. Account email is masked. Opt-in replay:ORCA_CURSOR_USAGE_PROOF_DIR=... ORCA_BACKGROUND_LAUNCH=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/cursor-usage-macos-desktop-login.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1.state.vscdb)Testing
Linux (Ubuntu, Node 24, pnpm 12).
pnpm typecheck,pnpm lint,pnpm test,pnpm buildpass locally, plus the cross-version wire suites and the mobile typecheck/lint/format/test checks. macOS desktopstate.vscdbwas exercised live on this machine (Ultra login, nocursor-agenton PATH); Windows credential-path resolution remains unit-tested (process.platform,APPDATA). WSL: Cursor auth is read from the host that runs the rate-limit service; if the login lives inside a WSL distro it is reported as not available (same as Grok today).Reviewer steps:
cursor-agenton the host, open Orca.state.vscdb/auth.json): the section shows sign-in guidance, nothing crashes or prompts.Tests: auth-path resolution per platform, JWT/cookie construction, desktop-vs-CLI precedence, read-only SQLite, absent vs corrupt/locked/unreadable/malformed stores, network/server/401 failures, usage-summary and sand mapping, absent pools, Grok Bot failure isolation, 401 without token leak, cancellation, service policy, default-on migration, status-bar visibility/gating/tooltip/error copy, Accounts section states, mobile old-host decoding and read-only route.
AI Disclosure
The port onto current
mainwas written by OpenAI Codex CLI (gpt-5.6-sol) from a design and audit produced with Claude (Anthropic), then independently re-validated (gates re-run, code review) by Claude Fable 5.1 and reviewed by me. Linux screenshots were taken with the repository's Playwright Electron fixture. macOS screenshots were captured the same way on 2026-09-21 against a live Cursor desktop login. The rebase onto currentmainand the macOS proof were done with Grok (xAI).Review
Cross-platform: credential roots selected behind
process.platformand built withpath.join; XDG affects Linux only; no child processes, no shell. Linux verified locally; macOS desktopstate.vscdbverified live; Windows path logic unit-tested, packaging via CI.SSH / remote / local: usage is fetched by the execution host's rate-limit service, so local, SSH, and paired-phone views report the host that owns the Cursor login; without a readable login the provider reports not available. Folder workspaces unaffected.
Supported agents and integrations: adds the Cursor provider only, gated like the other providers; nothing in Stats or Chat; no change to Claude/Codex/Gemini/Kimi/MiniMax/Grok/Antigravity paths.
Performance: shares the provider poll cycle and abort path; SQLite opened read-only in place with a 250 ms busy timeout (the database can be multi-GB, it is never copied); two HTTPS requests per poll with 10 s timeouts.
UI quality: compact and verbose status-bar modes, visibility toggle, tooltip states, Accounts section, search entries, five locale catalogs, existing tokens and shadcn primitives; mobile reuses the existing host-usage card pattern.
Security: the token stays on the execution host, is read from Cursor's own stores, and is sent only to Cursor's two HTTPS endpoints in their expected cookie/Bearer schemes. Errors never echo the token; 401/403 become sign-in guidance; mobile receives usage metadata only. The endpoints are the ones Cursor's own dashboard uses; there is no public per-user usage API for Pro/Ultra plans.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Size: roughly half of the additions are tests and the five locale catalogs; the prep refactor commit is behaviour-neutral. Shared with Grok/MiniMax: one
providerResultFromSettledhelper and one request-timeout helper replace the previously copied per-provider blocks. No baseline/ratchet files touched, no lint suppressions added. Known wire nuance shared with the earlier Grok toggle: a new client's default-on migration writes thecursorstatus-bar item, which an older host'sui.updateenum rejects for that payload; no protocol bump, same shape upstream accepted for Grok.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author
X (Twitter): none
🤖 Generated with Claude Code