CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Price Codex gpt-reserve usage as GPT-5.6 Luna Reserve

Open BUKOWSKIREAL opened this issue 2 months ago • 1 comments

Problem

CodexBar does not price Codex usage reported with the gpt-reserve model identifier. This is the Luna Reserve quota bucket used after the normal GPT-5.6 Luna quota is exhausted. The token usage appears in the Codex breakdown, but the model is not normalized to the bundled gpt-5.6-luna pricing entry, so its cost is unpriced and omitted from the dollar total.

Reproduction

  1. Use Codex while the Luna Reserve bucket is active (the Codex telemetry model identifier is gpt-reserve).
  2. Run CodexBarCLI cost --provider codex --format json --pretty --days 365.
  3. Inspect modelBreakdowns and totalCost.

gpt-reserve appears with token totals, but it has no priced cost contribution, while the known gpt-5.6-luna model is priced normally. This makes the reported Codex dollar total understated whenever reserve usage occurs.

Expected behavior

Treat gpt-reserve as the Luna Reserve telemetry alias for gpt-5.6-luna, so its input, cached-input, and output tokens use the existing bundled Luna estimate and contribute to the total.

OpenAI Codex issue #42830 documents the additional gpt-reserve bucket and the luna_reserve banner type. There is currently no CodexBar issue specifically covering this alias.

BUKOWSKIREAL avatar Sep 08 '26 08:09 BUKOWSKIREAL

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 8, 2026, 4:20 AM ET / 08:20 UTC.

Summary Current main still lacks the reserve alias, and the same author's open fix PR already owns the repair. Keep this issue open until that candidate is resolved; repository policy also disables automatic closure.

Reproducibility: yes. at the source level: gpt-reserve remains unchanged and has no bundled rate, yielding unknown cost without a matching catalog or override. No live account probe or test execution was performed.

Next step Review and resolve https://github.com/steipete/CodexBar/pull/3503 before closing this issue; an additional repair PR would duplicate existing work.

Review details

Best possible solution:

Resolve the verified reserve alias through the shared Luna pricing path while preserving custom overrides, provider isolation, historical rates, and repricing of existing usage.

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

Yes, at the source level: gpt-reserve remains unchanged and has no bundled rate, yielding unknown cost without a matching catalog or override. No live account probe or test execution was performed.

Is this the best way to solve the issue?

Yes, a shared alias mapping is the narrow repair if Reserve-to-Luna equivalence is confirmed; it should reuse existing pricing rather than introduce a separate rate table.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • The reported telemetry identifier is corroborated, but its equivalence to Luna's estimated rates remains to be verified during review of the linked fix.

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

Label changes

Label changes:

  • add P2: Missing reserve pricing affects estimated spending totals without blocking Codex use.
  • add impact:other: Reserve token usage can be excluded from dollar estimates; this is spending-report accuracy rather than lost usage data.
  • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
  • add clawsweeper:source-repro: Current issue advisory state selects this label.
  • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
  • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.

Label justifications:

  • P2: Missing reserve pricing affects estimated spending totals without blocking Codex use.
  • impact:other: Reserve token usage can be excluded from dollar estimates; this is spending-report accuracy rather than lost usage data.
Evidence reviewed

What I checked:

  • Current-main pricing gap: Checkout HEAD matches the supplied main SHA. normalizeCodexModel strips openai/ and handles the unsuffixed GPT-5.6 alias and dated variants, but leaves gpt-reserve unchanged. The bundled lookup returns nil when neither a catalog entry nor a bundled key matches. (Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift:523, b1e27d266a8e)
  • Existing Luna pricing contract: The bundled table already contains Luna input, cached-input, output, and long-context rates. Focused tests establish Luna fallback pricing and existing model-alias normalization. (Tests/CodexBarTests/CostUsagePricingTests.swift:220, b1e27d266a8e)
  • Production caller and supported override: Session rows pass their pricing model and token counters through the shared resolver. docs/model-pricing.md documents overlay > models.dev > builtin resolution; an explicit custom price is an existing workaround, but does not supply the missing default alias. (Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+PricingRows.swift:22, b1e27d266a8e)
  • Open implementation candidate: The supplied GitHub snapshot identifies https://github.com/steipete/CodexBar/pull/3503 as open, unmerged, authored by the issue reporter, and formally linked to close this issue. Its stated scope covers bare and OpenAI-qualified reserve aliases with regression coverage. (dee9424bf8a1)
  • Upstream identifier evidence: The linked upstream report describes the gpt-reserve quota bucket, luna_reserve banner, and composer override to gpt-reserve. This supports the telemetry identity claim, but is a user report rather than an authoritative rate-equivalence specification.
  • Official documentation check: The inspected official pricing page did not establish the Reserve-to-Luna rate mapping; a search within that page found no Reserve text.

Likely related people:

  • Yuxin Qiao: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Nikolai Berezovskii: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
How this review workflow works
  • 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.

clawsweeper[bot] avatar Sep 08 '26 08:09 clawsweeper[bot]