Skip to content

Price unreported Cursor events and show real spend coverage - #3129

Merged
steipete merged 15 commits into
steipete:mainfrom
Yuxin-Qiao:codex/spend-pricing-fallback
Aug 27, 2026
Merged

Price unreported Cursor events and show real spend coverage#3129
steipete merged 15 commits into
steipete:mainfrom
Yuxin-Qiao:codex/spend-pricing-fallback

Conversation

@Yuxin-Qiao

@Yuxin-Qiao Yuxin-Qiao commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Estimate Cursor events only when the vendor genuinely omits or nulls the cost. Explicit zero remains reported; malformed, nonfinite, negative, wrong-type, or overflowing costs remain unpriced. Estimates use existing cached/bundled API list prices, never Cursor-metered billing or Codex custom pricing.

This preserves @Yuxin-Qiao's typed cost-state repair and contributor commits, and completes the integration with current main:

  • Resolve the catalog lazily at most once per report, including when no cached catalog exists. Reported/invalid costs do not read it.
  • Preserve dated dotted Claude aliases, disjoint cache-token accounting, raw model identities, and event-date pricing.
  • Retain valid request coverage even when an invalid same-model event makes the total unavailable. Preserve compatible native Codex and Pi/OMP caches across the optional report-field hash transition; actual pricing changes still invalidate them.
  • Show established history days in Overview even when a selected subscription has no spend data. Keep the partial-subscription warning, partial amounts/tokens, and estimate provenance visible.

Docs and the Unreleased changelog are updated. Auth, fetching/pagination, charged cents, metered totals, provider ownership, and pricing data are unchanged.

Verification

Integrated head: 8ad662c3e021368e54ca9a8a1074b72b351a0d0f. This preserves all 13 contributor commits, including the concurrent cache-adoption update, and has a byte-identical Git tree to the fully tested/reviewed f5810c4ed0b33e03b39b4d1ec2fcaffe750b9420 repair. The overlapping two-file update was reconciled without a force push; both audited Pi/OMP predecessors remain covered.

All tests/checks unset CODEXBAR_ALLOW_TEST_KEYCHAIN_ACCESS and set CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 CODEXBAR_TEST_CODEX_FILE_ISOLATION=1; no real credentials, accounts, browser imports, or live provider requests were used.

  • Focused Swift tests: 277 tests / 14 suites passed, covering Cursor decoding/aggregation/pagination, retained reports, native/Pi caches, Overview, and spend publication. All 11 extracted fetching/pagination tests ran unchanged.
  • swift test --skip-build --filter ProviderArchitectureGatekeeperTests: 39 passed.
  • make check: passed, zero violations in 2,013 Swift files.
  • Independent Codex review of the complete integrated patch: no actionable findings.
  • Parent make test: 942 selections / 79 groups passed first time, zero failures, retries, or timeouts; 812.3 seconds including discovery.
  • Exact-head CI: all eight jobs passed, including both macOS shards and Linux x64/ARM64/musl; GitGuardian also passed. The earlier run was canceled by the concurrent contributor update, not a test failure.

The 2,000-event known/unknown fixture measures one catalog metadata read per report with either a cached or absent catalog, and zero with an injected catalog. Reported/invalid/rejected-token inputs also measure zero. Decoded JSON covers omission/null/zero, ten invalid-value spellings, mixed same-model ordering, and coverage through the actual report/snapshot path.

Native retained JSON and Pi/OMP fixtures prove adoption of both audited predecessor hashes without rebuilding/reparsing. Changed catalog/custom-pricing/formula inputs and unrelated parser hashes still invalidate and reparse. This optional-field change does not alter pricing formulas or the cache schema.

Before / after: production Overview

The same fixed synthetic Cursor event, actual report-to-snapshot-to-publication path, production card view, and hosted accessibility export are used in both captures. One Cursor subscription has $12 / 1,000 tokens and 30 established history days; another selected subscription is unavailable. The before source is exact main 8b1b9668e946a71ad9d6e98f6a53102e1488159f; only the production Overview implementation changes for the after capture. Both inputs are byte-identical.

Before: incorrect Coverage: 0 / 30 despite established history.

Before, light
Before, dark

After: Coverage: 30 / 30; ~$12.00, ~1K tokens, and 1 of 2 subscriptions have spend remain unchanged. Both light/dark images were inspected and the required text is present in hosted accessibility output.

After, light
After, dark

Render command: swift test --filter MenuLayoutScreenshotRenderTests.test_renderCursorOverviewCoverageProof with an isolated CODEXBAR_CURSOR_OVERVIEW_SCREENSHOT_DIR; the before capture additionally sets the expected-days assertion to zero. Seven-day and unestablished-history controls pass through the real model tests.

This is deterministic production-view and hosted-accessibility proof, not a claim of authenticated Cursor, live menu routing, or VoiceOver testing. The dated alias is a tested transformation, not a claimed observed wire incident. API list-price estimates are not actual Cursor invoices.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fb5d824e6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 27, 2026, 6:31 AM ET / 10:31 UTC.

ClawSweeper review

What this changes

This PR estimates Cursor events whose API cost is absent, keeps invalid reported costs unpriced, preserves compatible local caches, and corrects spend-history coverage in the Overview card.

Merge readiness

Blocked until real behavior proof from a real setup is added - 3 items remain

Keep open: the current main baseline does not contain the requested fallback, and the active owner integration has resolved the prior source findings. The remaining merge blocker is real Cursor behavior proof, because the submitted captures are synthetic XCTest renderer output rather than an observed Cursor session.

Priority: P2
Reviewed head: 8ad662c3e021368e54ca9a8a1074b72b351a0d0f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch and targeted coverage are strong, but merge readiness is capped by fixture-only behavior evidence.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The before/after captures use synthetic events through an XCTest renderer, not a real Cursor session that demonstrates the omitted-cost fallback after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The before/after captures use synthetic events through an XCTest renderer, not a real Cursor session that demonstrates the omitted-cost fallback after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current-main comparison: The main baseline lacks the typed cost state, omitted-cost fallback, and per-event coverage counts; these are introduced by this head, so the central behavior is not already implemented on main.
Fallback implementation: The report loop distinguishes omitted, valid, and invalid cost states, resolves a catalog lazily once, and only estimates omitted costs before retaining unpriced invalid values.
Focused regression coverage: New tests cover catalog-once resolution, invalid decoded costs, dated aliases, event-date pricing, cache adoption, and Overview coverage behavior.
Findings None None.
Security None None.

Live Verification

Command: CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 CODEXBAR_TEST_CODEX_FILE_ISOLATION=1 swift test --filter CursorEstimateCoverageTests

Result: FAIL (failed) — execution before step 1 expect_output: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz

Assertions:

  • FAIL expect_output: Test run with

How this fits together

Cursor usage events are decoded into daily usage and cost reports, then combined into the app’s spend dashboard. This change adds a local list-price fallback before those reports feed the Overview summary.

flowchart LR
A[Cursor usage events] --> B[Cost state decoder]
B --> C{Was cost reported?}
C -->|Missing or null| D[Local API-price catalog]
C -->|Reported or invalid| E[Daily usage report]
D --> E
E --> F[Spend overview card]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The before/after captures use synthetic events through an XCTest renderer, not a real Cursor session that demonstrates the omitted-cost fallback after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - A live Cursor payload with an omitted or null API cost has not been shown flowing through the application, so the new fallback remains unverified against the vendor’s real response shape.
  • Complete next step (P2) - Await redacted real Cursor proof before merge; there is no narrow mechanical repair to dispatch.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +208/-25; tests +1,085/-329; docs +4/-1 The substantial regression suite covers the new pricing, cache, and Overview paths more heavily than the implementation grows.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the bounded local-price fallback after a redacted real Cursor-session capture demonstrates an omitted or null cost flowing to the corrected spend output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the bounded local-price fallback after a redacted real Cursor-session capture demonstrates an omitted or null cost flowing to the corrected spend output.

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

No for live behavior: source and fixtures clearly exercise the new path, but no real Cursor session with an omitted or null cost is evidenced.

Is this the best way to solve the issue?

Yes structurally: the fallback is local, preserves reported and invalid values, and has focused coverage; live vendor-response proof is still needed before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8b1b9668e946.

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 availability: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded spend-reporting improvement with no demonstrated outage or security impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦞 diamond lobster.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The before/after captures use synthetic events through an XCTest renderer, not a real Cursor session that demonstrates the omitted-cost fallback after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Authored the current reconciliation commit and the owner discussion confirms ownership of the final landing pass. (role: recent area contributor and integration owner; confidence: high; commits: 8ad662c3e021; files: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift, Sources/CodexBarCore/PiSessionCostScanner.swift)
  • Yuxin-Qiao: History records prior Cursor aggregation fixes by Yuxin Qiao and the current head retains the contributor’s cost-state work. (role: recent Cursor cost contributor; confidence: high; commits: f6395d05b663, 0425dde33b41; files: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift)
  • Ethan Clinick: Introduced the original Cursor token-cost report that this change extends. (role: feature introducer; confidence: high; commits: 2209a9b63945; files: Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Post a redacted real Cursor-session capture or log showing an omitted/null cost event and the resulting estimated spend; update the PR body to trigger re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-22T02:06:07.305Z sha 45160c5 :: needs real behavior proof before merge. :: [P2] Classify rejected reported costs as unpriced
  • reviewed 2026-08-22T02:24:02.241Z sha ecfde41 :: needs real behavior proof before merge. :: [P2] Classify rejected reported costs as unpriced
  • reviewed 2026-08-22T03:16:59.648Z sha 380c1e5 :: needs real behavior proof before merge. :: [P2] Bypass Codex custom pricing for Cursor estimates
  • reviewed 2026-08-22T04:46:30.258Z sha f0a148b :: needs changes before merge. :: [P3] Remove or correct the unused catalog fallback
  • reviewed 2026-08-22T07:16:30.719Z sha 1aba446 :: needs changes before merge. :: [P2] Normalize Cursor Claude model aliases | [P2] Preserve coverage for valid same-model requests
  • reviewed 2026-08-22T10:42:08.104Z sha 3fa975a :: needs changes before merge. :: [P2] Preserve invalid totalCents instead of estimating it
  • reviewed 2026-08-27T09:31:51.634Z sha 85257de :: needs real behavior proof before merge. :: [P2] Resolve the pricing catalog once per report | [P2] Preserve dated Claude alias suffixes
  • reviewed 2026-08-27T10:01:23.940Z sha 85257de :: needs real behavior proof before merge. :: [P1] Preserve local cost caches across the hash transition | [P2] Resolve the catalog once per report | [P2] Preserve suffixes when mapping dotted Claude aliases

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7eed14f69f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45160c53d3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 22, 2026
@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/spend-pricing-fallback branch from 45160c5 to bd3b0be Compare August 22, 2026 02:14
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 380c1e5807

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 22, 2026
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Cursor emits claude-4.5-sonnet while bundled Claude catalog keys on claude-sonnet-4-5; map alias before fallback pricing so catalog estimates are not silently missed.

When the same model has both valid and rejected (negative/non-finite) costs, aggregate costUSD fails closed but per-event priced coverage must still be visible; track per-event pricedRequests and expose via pricedRequestCount to keep coverageCounts honest.
Decode totalCents into a typed Cost state (valid, omitted, invalid) so present non-finite (NaN, Infinity), negative, and malformed strings are distinguished from genuine omissions or nulls.

Only genuinely omitted/null totalCents are eligible for list-price estimation; invalid reported values stay unpriced, fail closed for the model aggregate, and never manufacture estimates.

Keep chargedCents and Cursor-metered totals untouched.

Update list-price helper documentation to note cached and bundled catalog lookups without network access.

Add comprehensive tests decoding JSON through CursorUsageEventsPage and makeDailyReport covering omitted, null, zero, valid string, negative, non-finite, and malformed costs mixed with valid events of the same model.
@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/spend-pricing-fallback branch from 3fa975a to dd30637 Compare August 27, 2026 08:36
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd3063777a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85257dec9e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/Providers/Cursor/CursorUsageEventsFetcher.swift Outdated
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 27, 2026
@steipete

Copy link
Copy Markdown
Owner

Thanks @Yuxin-Qiao. I rechecked 85257dec9ee2ef574b2e4e9555054bf6e0d78ff1: the typed cost state addresses the missing/null-versus-invalid decoder defect from my earlier review, and I will preserve that repair.

I’m taking the remaining bounded integration work on this PR after the current test-only cleanup lands: preserve unchanged native Codex and Pi/OMP caches across the optional report-field hash transition, resolve the cached pricing catalog once per report with deterministic fixtures, correct the dated dotted Claude alias ordering, and complete decoded-input/cache/Overview rendering proof. The estimate remains API list price; Cursor-metered charges and account/auth behavior stay unchanged.

This is a source-review acknowledgment, not a claim that the current head has passed local execution or is ready to merge. I’ll update the branch and final proof here before landing.

steipete and others added 2 commits August 27, 2026 03:19
Integrate current main and complete catalog-once resolution, date-safe Claude
aliases, decoded cost-state coverage, and compatible retained-report adoption.
Keep Cursor API list-price estimates separate from metered billing and native
custom pricing, with production Overview rendering and cache regressions.

Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
Keep Codex local history and Pi/OMP caches compatible when report gains optional pricedRequestCount field. Add predecessor hash 55f640e6bb0ccba4 to CostUsageStore.compatiblePredecessorParserHashes and allow PiSessionCostScanner to match pricingKey for new hash 21f10143afe00c55 via compatible key c6c46a376ba16304, avoiding unnecessary rebuild of unrelated Codex history.
@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/spend-pricing-fallback branch from f5810c4 to 7bf75c9 Compare August 27, 2026 10:21
Preserve the contributor's parallel cache-adoption commit and the complete
tested integration. Keep both audited Pi/OMP predecessor keys, along with
native cache adoption and the existing regression coverage.

Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
@steipete

Copy link
Copy Markdown
Owner

Thanks @Yuxin-Qiao — I incorporated your concurrent 7bf75c9 cache update without rewriting either history. The integrated head is now 8ad662c3e021368e54ca9a8a1074b72b351a0d0f, with all 13 contributor commits retained. It also preserves Pi/OMP caches from both audited predecessor hashes, not only the older scheduler predecessor.

The complete tree is byte-identical to the repair that passed 942 selections across 79 groups, with no failed groups, retries, or timeouts. Focused decoding/cache/publication tests, format/lint, independent review, and the production Overview light/dark plus accessibility captures are complete; the PR body contains the evidence and its nonlive limitations. I verified and resolved the 11 inline findings against that implementation.

The earlier CI run was canceled by the concurrent branch update, not a test failure. I’m owning the final landing pass on the new exact-head CI run. Please leave this head stable while it completes; I’ll address any new actionable findings before merging.

@clawsweeper clawsweeper Bot removed merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 27, 2026

@steipete steipete left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed 8ad662c3e021368e54ca9a8a1074b72b351a0d0f. The original missing/null-versus-invalid decoder finding is addressed, along with report-scoped catalog resolution, dated aliases, valid request coverage, and compatible native/Pi cache adoption. Cursor estimates remain catalog API list prices, separate from metered charges and native custom pricing. All 11 inline findings were checked against the implementation and resolved.

The integrated tree matches the independently reviewed and locally tested repair byte-for-byte: 277 focused tests, 39 architecture tests, 942 selections/79 full-suite groups with no retries/timeouts, and clean format/lint. Before/after production-card and hosted-accessibility proof is attached; authenticated provider/menu/VoiceOver behavior was not claimed. Exact-head CI passed all eight jobs, including both macOS shards and Linux x64/ARM64/musl; GitGuardian passed too. No unresolved review threads remain.

The automated exact-head rereview also reports no actionable code or security findings. Its remaining request is a naturally occurring authenticated Cursor example with an omitted cost. For this bounded local report transformation, I accept the decoded-input, cache-upgrade and production-view proof: transport/auth/pagination and metered billing are unchanged, and the report/estimate claims remain explicitly limited to those tested inputs. This is not a claim that a live account probe was performed. The bot's attempted test stopped in its pnpm setup before Swift execution; it does not contradict the completed local tests or exact-head CI.

@steipete
steipete merged commit 5b86029 into steipete:main Aug 27, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Owner

Landed as 5b8602981baac73a52228e266084586a2c2b7b1a after verifying exact head 8ad662c3e021368e54ca9a8a1074b72b351a0d0f. The concurrent contributor cache update was incorporated without rewriting the PR branch; its final tree is byte-identical to the fully tested/reviewed f5810c4 integration. Contributor credit is retained in the commit and changelog.

Verification used env -u CODEXBAR_ALLOW_TEST_KEYCHAIN_ACCESS CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 CODEXBAR_TEST_CODEX_FILE_ISOLATION=1:

  • make test: 942 selections / 79 groups, all first-pass, zero failures/retries/timeouts; 812.3 seconds including discovery.
  • make check: clean, zero lint violations in 2,013 Swift files.
  • swift test --filter 'CursorUsageEventsFetcherTests|CursorUsageEventsPaginationTests|CursorEstimateCoverageTests|CostUsageCoverageCompatibilityTests|PiSessionCostCompatibilityTests|PiSessionCostScannerTests|OverviewSpendSummaryTests|CostUsageStoreTests|CostUsageDecodingTests|SpendDashboardModelTests|SpendDashboardPublicationTests|SpendDashboardPartialCostTests|SpendDashboardDateTruthTests|CostUsageTokenSnapshotDaySelectionTests': 277 tests / 14 suites passed.
  • swift test --skip-build --filter ProviderArchitectureGatekeeperTests: 39 passed.
  • swift test --filter MenuLayoutScreenshotRenderTests.test_renderCursorOverviewCoverageProof: before/after light/dark production-card renders and hosted accessibility exports passed. Exact main before source and identical synthetic inputs were verified; final source was restored and retested. Images are in the PR body and their uploaded bytes were verified against the originals.
  • Independent Codex review: no actionable findings in the complete integrated patch. Final reconciliation changed history only, not the tested tree.
  • Exact-head CI: all eight jobs passed, including both macOS shards (28m20s / 28m57s) and Linux x64/ARM64/musl; GitGuardian also passed. The previous run was canceled by the concurrent contributor push, not a test failure. The final run needed no rerun.

The 2,000-event fixtures prove at most one catalog metadata read per report, including a missing catalog. Retained native reports and both audited Pi/OMP predecessors hydrate without unnecessary reparsing, while actual pricing changes still invalidate. Mixed invalid/estimated/reported events preserve honest coverage.

No real account, credential, browser import, authenticated provider request, app relaunch, live menu, or VoiceOver test was used. The Overview proof is the actual production view fed by synthetic report/publication data; the dated alias is a deterministic regression, not a claimed wire incident. Metered Cursor billing is unchanged. After merging, main was fast-forwarded and verified clean at the merge commit, with ancestry and exact tree equality to the tested head. The separate post-merge main CI is now running.

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

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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