Skip to content

fix(server): price Daybreak usage aliases - #7753

Open
obinnanwachukwu1 wants to merge 1 commit into
pingdotgg:mainfrom
obinnanwachukwu1:fix/daybreak-usage-pricing
Open

fix(server): price Daybreak usage aliases#7753
obinnanwachukwu1 wants to merge 1 commit into
pingdotgg:mainfrom
obinnanwachukwu1:fix/daybreak-usage-pricing

Conversation

@obinnanwachukwu1

@obinnanwachukwu1 obinnanwachukwu1 commented Aug 21, 2026

Copy link
Copy Markdown

Problem

Codex records Daybreak models in rollout transcripts as gpt-daybreak-blue-latest and gpt-daybreak-red-latest, while LiteLLM publishes their pricing under daybreak-blue-latest and daybreak-red-latest.

Because Usage performed an exact normalized rate lookup, Daybreak tokens were included in token totals but marked unpriced and contributed $0.00 to the API-equivalent cost.

Closes #7752

Fix

Add a small alias fallback at the LiteLLM pricing boundary.

Exact rate-table matches still take precedence, so a future native LiteLLM entry for a Codex slug automatically overrides the fallback. Codex model selection and stored transcript identifiers remain unchanged.

Because Usage calculates pricing when it reads transcripts, this prices existing Daybreak history without a migration.

Verification

  • vp test run apps/server/src/usage/usagePricing.test.ts apps/server/src/usage/usageAggregation.test.ts
  • vp lint apps/server/src/usage/usagePricing.ts apps/server/src/usage/usagePricing.test.ts
  • vp run --filter t3 typecheck
  • Verified in the Usage page with the same 24-hour Daybreak history before and after the change

Built with GPT-5.6 Sol using Codex in T3 Code.


Note

Low Risk
Narrow pricing-lookup change with tests; it only remaps two model names at cost calculation time and does not touch auth, billing charges, or stored transcripts.

Overview
Fixes Daybreak usage showing as unpriced ($0.00) because Codex transcripts use gpt-daybreak-*-latest while LiteLLM publishes rates as daybreak-*-latest.

lookupRate now falls back to a small alias map after an exact table match. Exact LiteLLM keys still win, and stored model names are unchanged. Existing Daybreak history is priced on read without a migration.

Reviewed by Cursor Bugbot for commit b0a9f50. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Daybreak usage aliases to lookupRate in usagePricing

Introduces a LITELLM_RATE_ALIASES mapping so gpt-daybreak-blue-latest and gpt-daybreak-red-latest resolve to daybreak-blue-latest and daybreak-red-latest pricing entries. lookupRate first does a direct table lookup, then falls back to the alias mapping; exact table matches always win over aliases. Adds test coverage for alias resolution, exact-match preference, and unknown-model handling.

Macroscope summarized b0a9f50.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0fc0d746-8aa2-4014-8ee2-ff6935074ce2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 21, 2026
@obinnanwachukwu1
obinnanwachukwu1 force-pushed the fix/daybreak-usage-pricing branch from 4b8f07a to b0a9f50 Compare August 21, 2026 04:12
@obinnanwachukwu1
obinnanwachukwu1 marked this pull request as ready for review August 21, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Usage leaves Daybreak models unpriced because Codex and LiteLLM use different aliases

1 participant