Skip to content

Update GPT-5.6 Terra and Luna pricing - #2521

Closed
iam-brain wants to merge 3 commits into
steipete:mainfrom
iam-brain:iam-brain/update-gpt56-pricing
Closed

Update GPT-5.6 Terra and Luna pricing#2521
iam-brain wants to merge 3 commits into
steipete:mainfrom
iam-brain:iam-brain/update-gpt56-pricing

Conversation

@iam-brain

Copy link
Copy Markdown
Contributor

OpenAI reduced GPT-5.6 Terra and Luna API pricing effective July 30. This updates CodexBar's bundled fallback rates for standard, cache, and long-context usage while preserving Sol pricing, plus refreshes focused coverage and the generated pricing fingerprint.

Source: OpenAI: Advancing the price-performance frontier with GPT-5.6

Validation:

  • swift test --filter CostUsagePricingTests
  • make check
  • make test (758 selections)

@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 6:39 PM ET / 22:39 UTC.

ClawSweeper review

What this changes

Updates bundled GPT-5.6 Terra and Luna fallback pricing, retains pre-July-30 rates for historical usage, and passes usage dates through Codex cost calculations.

Merge readiness

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

Keep open: current main still has the older Terra and Luna fallback rates, while this PR updates them and preserves historical totals. The patch has no concrete correctness finding, but it is currently conflict-marked and lacks after-fix real-behavior proof.

Priority: P2
Reviewed head: 5e3576315ac77b34d648f5be9e93acff51bac251

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and covered by tests, but it is not merge-ready without real after-fix behavior proof.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR provides claimed focused tests and green CI, but no redacted after-fix app or terminal scan output; add real behavior proof, redact private data, and update the PR body for automatic re-review (or ask a maintainer to comment @clawsweeper re-review).
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR provides claimed focused tests and green CI, but no redacted after-fix app or terminal scan output; add real behavior proof, redact private data, and update the PR body for automatic re-review (or ask a maintainer to comment @clawsweeper re-review).
Evidence reviewed 5 items Current main still needs the correction: Current main retains the older Terra and Luna standard fallback values, so the central pricing update is not already implemented.
Branch preserves date-sensitive totals: The proposed branch uses a July 30 UTC cutoff with the former Terra and Luna tuples, and its tests exercise values before and at that boundary.
All persisted-row paths receive the date: The branch adds UTC day parsing at the row-cost, audit, summary, and Pi-session call paths rather than applying the new rate indiscriminately to historical records.
Findings None None.
Security None None.

How this fits together

CodexBar scans local Codex usage records and applies bundled fallback rates when a model catalog is unavailable. This change feeds each usage row’s date into that calculation so displayed historical cost totals use the rate effective on that day.

flowchart LR
A[Local Codex usage records] --> B[Daily usage rows]
B --> C[UTC pricing date]
C --> D[Historical or current fallback rate]
D --> E[Cost calculation]
E --> F[Usage totals in CodexBar]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR provides claimed focused tests and green CI, but no redacted after-fix app or terminal scan output; add real behavior proof, redact private data, and update the PR body for automatic re-review (or ask a maintainer to comment @clawsweeper re-review).
  • Resolve merge risk (P1) - GitHub currently reports a dirty merge state, so the branch needs a rebase and a fresh three-way review against current main.
  • Resolve merge risk (P2) - Changing fallback rates changes displayed costs; the historical cutoff mitigates retroactive changes, but a real scan must confirm the row-date paths after rebase.
  • Complete next step (P2) - A contributor-owned real setup proof and a conflict rebase are required; neither can be safely produced by the repair lane.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +141/-52, tests +90/-5 Most production growth implements date-aware fallback history; focused pricing tests cover the new rate and cutover boundary.

Merge-risk options

Maintainer options:

  1. Rebase and prove the two-date result (recommended)
    Rebase onto current main, retain the UTC historical-rate coverage, and post redacted output from a real scan showing the pre-cutover and current-date totals before merge.

Technical review

Best possible solution:

Land a rebased branch only after a redacted real scan demonstrates pre-cutover and current Terra/Luna records receiving their respective rates.

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

Yes, source-reproducible: current main contains the former bundled values and the branch deterministically selects old or new tuples from each row date. No after-fix real scan has been supplied.

Is this the best way to solve the issue?

Yes, conditionally: date-aware fallback history with UTC day parsing is a narrow way to avoid retroactively changing prior totals. It should be rebased and demonstrated against a real scanned record before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 47e1d0426236.

Labels

Label justifications:

  • P2: This corrects bounded cost reporting for two GPT-5.6 fallback tiers without evidence of an availability or security incident.
  • merge-risk: 🚨 compatibility: The patch changes displayed historical and current usage costs, so the preserved cutoff behavior must survive rebase and runtime validation.
  • 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. Needs real behavior proof before merge: The PR provides claimed focused tests and green CI, but no redacted after-fix app or terminal scan output; add real behavior proof, redact private data, and update the PR body for automatic re-review (or ask a maintainer to comment @clawsweeper re-review).

Evidence

What I checked:

Likely related people:

  • Stephen: Authored the original bundled Sol/Terra/Luna pricing addition. (role: introduced GPT-5.6 pricing behavior; confidence: high; commits: aa40f1eb4b5e; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift, Tests/CodexBarTests/CostUsagePricingTests.swift)
  • Peter Steinberger: Authored the subsequent GPT-5.6 pricing stabilization and is the current blame owner for the checked-in pricing and row-cost paths. (role: recent area contributor; confidence: high; commits: 501e95150fd5, 6a16c23313a7; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift, Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+CacheHelpers.swift)

Rank-up moves

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

  • Rebase onto current main and resolve the reported merge conflict.
  • Add redacted terminal or app output from a real scan showing both sides of the July 30 cutoff.

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 (7 earlier review cycles)
  • reviewed 2026-07-30T22:36:48.379Z sha 29a46c4 :: needs real behavior proof before merge. :: [P2] Verify non-standard billing rates from a provider contract
  • reviewed 2026-07-31T04:42:50.959Z sha 5e35763 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-31T05:23:25.050Z sha 5e35763 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T11:47:27.176Z sha 5e35763 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T13:53:40.449Z sha 5e35763 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T15:55:47.351Z sha 5e35763 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T19:01:33.861Z sha 5e35763 :: needs real behavior proof before merge. :: none

@iam-brain
iam-brain marked this pull request as ready for review July 31, 2026 00:19

@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: 29a46c48a3

ℹ️ 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 on lines +218 to +220
inputCostPerToken: 2e-6,
outputCostPerToken: 1.2e-5,
cacheReadInputCostPerToken: 2e-7,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve old rates before the July 30 cutover

For bundled-fallback pricing of Terra or Luna usage dated before 2026-07-30, these replacements retroactively apply the new rates. codexCostUSD accepts no pricing date, and callers such as codexRowsCostUSD and codexRowCostBreakdown do not pass row.day; the changed pricing fingerprint also forces cached history to be rescanned. Consequently, pre-cutover Terra costs are reduced by 20% and Luna costs by 80%, corrupting historical totals. Keep the old and new tuples behind an effective-date cutoff and price each row using its recorded date.

Useful? React with 👍 / 👎.

@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: ae55da1b64

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

inputTokens: row.input,
cachedInputTokens: row.cached,
outputTokens: row.output,
pricingDate: CostUsageDateParser.parse(row.day),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse pricing cutover days in a fixed time zone

When the process runs east of UTC (for example, Asia/Tokyo), CostUsageDateParser interprets 2026-07-30 as local midnight, which is still before the UTC cutoff at epoch 1_785_369_600. As a result, every Terra/Luna row bucketed on July 30 is charged the old rates (including Luna at 5× the new price), and the added row-pricing test changes behavior with the runner's time zone. Compare the day key directly or parse it in a fixed cutoff time zone instead of using TimeZone.current.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 31, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Thank you for catching the July 30 price cut so quickly! The Terra/Luna rate reduction has since landed on main via #2632 (commit 405a2a4, "Define Codex Fast cost as API Fast USD"), which carries the same new standard/cache/long-context rates, so this PR is superseded on its core change. Closing as part of a stale-queue cleanup. If the date-aware historical-pricing mechanism from this branch (keeping pre-July-30 rates for old usage) is still something you'd like to land, a fresh PR rebased on current main with just that piece would be great.

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

Labels

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: 🧂 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