Skip to content

Preserve exact GPT-5 Codex pricing keys#511

Merged
ratulsarna merged 3 commits intosteipete:mainfrom
iam-brain:bryan/codex-gpt5-catalog-cleanup
Mar 14, 2026
Merged

Preserve exact GPT-5 Codex pricing keys#511
ratulsarna merged 3 commits intosteipete:mainfrom
iam-brain:bryan/codex-gpt5-catalog-cleanup

Conversation

@iam-brain
Copy link
Copy Markdown
Contributor

@iam-brain iam-brain commented Mar 12, 2026

Summary

  • Stop collapsing Codex/OpenAI GPT-5 model IDs onto base GPT-5 entries during pricing lookup. We were previously stripping -codex and effectively pricing persisted usage as a different model than the one the scanner recorded, which made local cost reports harder to trust and hid model-specific behavior in breakdowns.
  • Expand the Codex pricing catalog to include the missing non-chat GPT-5 family entries that now appear in real persisted usage data. This keeps pricing aligned with the exact model IDs we ingest instead of relying on partial aliases or nonexistent base-model fallbacks.
  • Treat gpt-5.3-codex-spark as a zero-cost Research Preview case. The goal is to keep preview usage visible in scanner output, CLI payloads, and chart details without incorrectly charging it or dropping it from breakdowns just because the cost is zero.
  • Preserve exact model IDs end to end through normalization, scanner aggregation, JSON payloads, and cost-history detail rendering. We took the explicit-table approach here so the supported pricing surface is obvious in code, dated suffixes are only stripped when the exact undated model exists, and we do not silently map future GPT-5 variants onto the wrong model.

Validation

  • swift test --filter 'CostUsagePricingTests|CostUsageScannerTests|CostUsageDecodingTests|CLICostTests|UsageFormatterTests'
  • pnpm check
  • ./Scripts/compile_and_run.sh

Copy link
Copy Markdown

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

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: 3e74f2e168

ℹ️ 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/Vendored/CostUsage/CostUsagePricing.swift
Comment thread Sources/CodexBar/CostHistoryChartMenuView.swift
@ratulsarna
Copy link
Copy Markdown
Collaborator

@codex review

Copy link
Copy Markdown

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

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: 3e74f2e168

ℹ️ 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/Vendored/CostUsage/CostUsagePricing.swift
@ratulsarna ratulsarna merged commit ec22e08 into steipete:main Mar 14, 2026
4 checks passed
@ratulsarna
Copy link
Copy Markdown
Collaborator

Thanks @iam-brain !

@iam-brain
Copy link
Copy Markdown
Contributor Author

Thought I asked this earlier but forgot @ratulsarna, bumping Codex's cache to v2 to clear the old cache so sessions can revalidate using the new models was the smallest change doable to introduce the new models and wanted to ask your opnion on that. Keep that small bandaid or should something be introduced to flush the cache with each model update?

@stamsam stamsam mentioned this pull request Apr 2, 2026
pablogtzgileta pushed a commit to pablogtzgileta/CodexBar that referenced this pull request Apr 8, 2026
* Preserve exact GPT-5 Codex pricing keys

* Suppress zero-cost chart peak

* Bump Codex cache artifact version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants