Update GPT-5.6 Terra and Luna pricing - #2521
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 6:36 PM ET / 22:36 UTC. ClawSweeper reviewWhat this changesThis PR updates CodexBar’s bundled GPT-5.6 Terra and Luna fallback prices, refreshes the generated pricing fingerprint, and updates focused cost-calculation expectations. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open. The standard Terra and Luna prices match the PR-linked OpenAI announcement, but the patch also changes cache and long-context billing rates without an authoritative source, despite the existing pricing table documenting those values as provider contracts rather than derivations. It also needs real after-fix runtime proof before merge. Priority: P2 Review scores
Verification
How this fits togetherCodexBar turns model token counts into USD usage estimates through its CostUsage pricing table. It prefers catalog data when available and otherwise uses the bundled rate tuples changed here, so incorrect fallback rates directly affect displayed cost estimates. flowchart LR
A[Model token counts] --> B[Catalog pricing lookup]
B --> C{Catalog rate available?}
C -->|Yes| D[Catalog-backed cost estimate]
C -->|No| E[Bundled GPT-5.6 rate table]
E --> F[Token cost calculation]
D --> G[Displayed USD usage]
F --> G[Displayed USD usage]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Verify each changed cache, cache-write, and long-context term against the complete authoritative GPT-5.6 pricing contract, retain any field without direct support, then attach redacted terminal or app evidence of the fallback calculation using the corrected rates. Do we have a high-confidence way to reproduce the issue? No high-confidence runtime reproduction was supplied. Source review does show a concrete verification path: compare every changed bundled billing dimension with the authoritative provider rate card, because the linked announcement confirms only standard input/output pricing. Is this the best way to solve the issue? No. Updating the four announced standard rates is appropriate, but deriving cache and long-context terms conflicts with the existing contract-aware design; those values should change only with direct provider evidence. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ef86077e70a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
There was a problem hiding this comment.
💡 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".
| inputCostPerToken: 2e-6, | ||
| outputCostPerToken: 1.2e-5, | ||
| cacheReadInputCostPerToken: 2e-7, |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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), |
There was a problem hiding this comment.
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 👍 / 👎.
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 CostUsagePricingTestsmake checkmake test(758 selections)