Skip to content

Price Cursor Grok and Composer list-price estimates - #5240

Open
Chipagosfinest wants to merge 10 commits into
steipete:mainfrom
Chipagosfinest:cursor/20261201-142236
Open

Chipagosfinest wants to merge 10 commits into
steipete:mainfrom
Chipagosfinest:cursor/20261201-142236

Conversation

@Chipagosfinest

Copy link
Copy Markdown
Contributor

Summary

  • Cursor API-rate estimates now price omitted-totalCents events for Grok (grok-4.5 / grok-4.6 / grok-4.7) through models.dev xai with bundled public list-price fallback.
  • Composer (composer-2.5, composer-2.5-fast) uses Cursor published list prices (models.dev has no composer entry); vendor-supplied totalCents including zero is never overridden.
  • Docs/CHANGELOG updated; synthetic before/after proof under .github/pr-proof/cursor-grok-composer-estimate-*.

Test plan

  • Red proof: omitted totalCents for grok-4.6 / composer-2.5 yielded costUSD == nil (.github/pr-proof/cursor-grok-composer-estimate-before-summary.txt)
  • Green: CODEXBAR_CORE_ONLY_TESTS=1 swift test --filter CursorUsageEventsFetcherTests → 36 tests passed (CLT-only local harness; full Xcode unavailable on this agent host)
  • swiftformat on touched Swift files
  • swiftlint --strict / make check need full Xcode (SourceKit/actool); please rely on CI
  • CI macOS Swift tests on this head

Made with Cursor

Estimate omitted totalCents for Grok via models.dev xai (bundled fallback) and Composer via Cursor published rates without overriding vendor cents.

Co-authored-by: Cursor <cursoragent@cursor.com>
@clawsweeper

clawsweeper Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🦞👀
Pull request received.

ClawSweeper review complete

ClawSweeper finished reviewing this revision.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-06T00:52:30.268120Z accab51 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Dec 1, 2026
@clawsweeper

clawsweeper Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

This PR adds Grok and Composer list-price estimates for Cursor events whose reported cost is missing.

Example: A composer-2.5 event omits totalCents and contains 100 input, 200 cached-read, and 50 output tokens.

  • Before: The event remains unpriced.
  • After: The event contributes a $0.000215 estimate and one estimated request.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has no definite source findings, but synthetic unit logs do not satisfy the required real-behavior proof gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Cursor spend reports leave Grok and Composer requests unpriced when Cursor omits their API-rate cost.
Reason: The added coverage has clear value and preserves billing boundaries, but owner direction for the feature is not recorded.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR adds useful model coverage absent from main, and no definite implementation defect was found; the repository policy also prohibits automatic closure.

Reviewed head: fe156709d9b5b302ad6d014fb1bde430ff5386a5
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Cursor's omitted-cost estimates gain bundled Grok and Composer pricing as proposed in this PR?
  • Recommendation: Approve the model coverage: Accept the provider-local fallback tables and existing estimate-versus-metered distinction, subject to the separate behavior-proof gate.
  • Why: This adds supported model pricing beyond the current unknown-model contract, and no written owner approval for this expansion appears in the discussion.

Before merge

  • Add real behavior proof - The supplied logs exercise CursorUsageEventsFetcher.makeDailyReport with synthetic events in Swift tests on a CLT-only macOS setup and show passing after-fix arithmetic, but do not exercise a shipped CLI or app with real Cursor data; redact IPs, keys, phone numbers, and non-public endpoints from contributed proof. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted terminal output or a recording from the freshly built shipped CLI or app showing real omitted-cost Grok and Composer events producing labeled estimates, with reported zero and Cursor-metered amounts preserved.
Agent review details

How this fits together

Cursor usage events from dashboard requests or local JSON enter the daily report builder, which preserves reported costs and estimates omitted costs before returning model and daily spend totals.

flowchart TD
  A[Cursor dashboard events] --> C[Daily report builder]
  B[Local Cursor JSON] --> C
  C --> D[Reported cost state]
  D --> E[Existing Codex and Claude pricing]
  E --> F[xAI catalog and bundled model rates]
  D --> G[Daily and model spend reports]
  F --> G
Loading

Technical review

Best possible solution:

If the owner accepts the expanded model coverage, retain the focused provider-local rates and existing shared cost arithmetic with clearly labeled list-price estimates.

Do we have a high-confidence way to reproduce the issue?

Current-main routing lacks xAI and Composer fallback prices, and the supplied red tests show the resulting nil costs; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The implementation reuses shared provider pricing and token arithmetic while keeping bundled rows local to Cursor, making it a focused approach if the owner accepts the added coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a26ca57b5186.

Provenance checked

  • Cursor omitted-cost estimation and reporting keeps the original intent (5b86029: Estimate genuinely omitted costs using cached or bundled API prices while preserving reported zero, invalid costs, disjoint token counters, request coverage, and separate metered billing.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c0f0ac1 adds Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:470 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c0f0ac1be9f8; files: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift)
  • Yuxin Qiao: Raw commit 5b86029 adds Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:559 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5b8602981baa; files: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift)
  • Ethan Clinick: Raw commit 2209a9b adds Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift:332 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2209a9b63945; files: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift)
  • Alec Gutman, Chip: Raw commit 5e15f7e adds Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing+Provider.swift:54 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5e15f7e4f060; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing+Provider.swift)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Patch composition Production +82/-3; tests +196; proof artifacts +1,421 lines Production growth is focused on pricing rows and routing; most added volume consists of compiler and unit-test logs.

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed December 1, 2026, 5:50 PM ET / 22:50 UTC.

Chipagosfinest and others added 9 commits December 1, 2026 14:51
Move the new suite out of CursorUsageEventsFetcherTests and drop redundant nil coalescing so SwiftLint type_body_length and redundant_nil_coalescing stay clean.

Co-authored-by: Cursor <cursoragent@cursor.com>
Store non-optional model costs in the bundled-rate assertion map so Swift can type-check the approxEqual helpers on CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid Dictionary(uniqueKeysWithValues:) inference failures on Xcode 27 by reading model breakdowns directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Annotate the Grok models.dev xai lookup as provider-specific by design so the cross-provider cluster gatekeeper accepts the Cursor estimate path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Verify public Grok and Composer list prices, cover the exact 200K prompt boundary in both pricing routes, and preserve released Codex cache compatibility. Remove committed proof artifacts and document the estimate boundary.
Regenerate the parser hash from the combined source and retain cache migration coverage for both parent hashes, preserving native rows and scan checkpoints.

This branch has not been deployed

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

Labels

impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants