Skip to content

[providers] 🤖 fix: estimate Codex OAuth costs - #4099

Merged
coadler merged 2 commits into
mainfrom
oauth-billing-aa11
Sep 6, 2026
Merged

[providers] 🤖 fix: estimate Codex OAuth costs#4099
coadler merged 2 commits into
mainfrom
oauth-billing-aa11

Conversation

@coadler

@coadler coadler commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Show API-equivalent dollar estimates for new Codex OAuth usage instead of forcing costs to $0.

Background

OAuth can consume paid Business workspace credits. Authentication alone does not prove that usage is free.

Implementation

  • Remove automatic subscription-covered markers from chat, tool, and background model calls.
  • Keep model pricing, cached-token pricing, and reasoning-token pricing in the existing calculation path.
  • Update Settings to explain the estimates and possible credit charges.
  • Keep existing legacy costsIncluded behavior. Do not add historical migrations or backfills.

Risks

The displayed amounts estimate API-equivalent usage, not exact credit charges. They do not change provider billing.
Dollar-based goal budgets now count new OAuth usage. Historical usage and upgraded-workspace aggregate reconciliation are outside this PR.
Repricing old mixed aggregates can change their displayed totals; this PR does not repair them.


Generated with xum • Model: openai:gpt-6-astra • Thinking: high • Cost: $27.16

Use API-equivalent estimates for new Codex OAuth requests.
OAuth authentication does not prove that usage is free.
Preserve historical totals and remove automatic zero-cost metadata.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$12.98`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=12.98 -->

Co-authored-by: Mux <noreply@coder.com>
@coadler

coadler commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

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

ℹ️ 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 src/node/services/providerModelFactory.ts
Do not add historical usage migration to this change.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$27.16`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=27.16 -->

Co-authored-by: Mux <noreply@coder.com>
@coadler

coadler commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

The user explicitly requests estimates for new usage only. Historical usage migrations are outside the requested scope.
The PR now documents the limitation for old mixed aggregates.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 7dd44d4e40

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

@coadler
coadler added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit d380989 Sep 6, 2026
19 of 20 checks passed
@coadler
coadler deleted the oauth-billing-aa11 branch September 6, 2026 16:21
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.

1 participant