Skip to content

FIX: Account for subscription benchmarks in quota estimates - #33

Merged
merefield merged 2 commits into
mainfrom
codex/account-subscription-benchmarks
Aug 24, 2026
Merged

FIX: Account for subscription benchmarks in quota estimates#33
merefield merged 2 commits into
mainfrom
codex/account-subscription-benchmarks

Conversation

@merefield

Copy link
Copy Markdown
Owner

What changed

  • fold finalized subscription-funded Core, Extended, and DigBench usage into quota API-equivalent accounting
  • defer both SPEND/NOW and 100%/FULL estimates while benchmark accounting is active or settling
  • exclude API-key-funded benchmarks and fail closed when benchmark usage cannot be priced
  • retain the existing hidden-session behavior while documenting and testing aggregate quota impact

Why

Benchmark sessions use ephemeral app-server threads. They consume subscription quota but do not enter the persisted rollout telemetry used by Codexometer, which could substantially understate both consumed and projected API-equivalent value.

Validation

  • go vet ./...
  • test -z "$(gofmt -l .)"
  • go test -race -cover ./... -count=1
  • go build -trimpath ./...

@merefield merefield changed the title [codex] Account for subscription benchmarks in quota estimates FIX: Account for subscription benchmarks in quota estimates Aug 24, 2026
@merefield
merefield marked this pull request as ready for review August 24, 2026 10:58
@merefield
merefield requested a balanced review from Copilot August 24, 2026 10:59

Copilot AI 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.

🟡 Changes recommended

Two pricing paths can accept incomplete telemetry or incorrectly price cumulative long-context usage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds subscription-funded benchmark usage to quota estimates while deferring incomplete accounting.

Changes:

  • Tracks and prices benchmark usage by billing source.
  • Defers quota estimates during active/settling benchmarks.
  • Adds documentation and accounting tests.
File summaries
File Description
README.md Documents benchmark quota behavior.
internal/ui/quota_api_eq.go Defers API-equivalent display.
internal/ui/model.go Integrates benchmark accounting lifecycle.
internal/ui/benchmark_quota.go Implements benchmark usage accounting.
internal/ui/benchmark_quota_test.go Tests accounting behavior.
internal/codex/benchmark.go Exposes benchmark billing source.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/ui/benchmark_quota.go Outdated
Comment thread internal/ui/benchmark_quota.go Outdated
@merefield
merefield merged commit 7b3685f into main Aug 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants