fix(server): price Daybreak usage aliases - #7753
Open
obinnanwachukwu1 wants to merge 1 commit into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
obinnanwachukwu1
force-pushed
the
fix/daybreak-usage-pricing
branch
from
August 21, 2026 04:12
4b8f07a to
b0a9f50
Compare
obinnanwachukwu1
marked this pull request as ready for review
August 21, 2026 04:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Codex records Daybreak models in rollout transcripts as
gpt-daybreak-blue-latestandgpt-daybreak-red-latest, while LiteLLM publishes their pricing underdaybreak-blue-latestanddaybreak-red-latest.Because Usage performed an exact normalized rate lookup, Daybreak tokens were included in token totals but marked unpriced and contributed
$0.00to 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.tsvp lint apps/server/src/usage/usagePricing.ts apps/server/src/usage/usagePricing.test.tsvp run --filter t3 typecheckBuilt 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 usegpt-daybreak-*-latestwhile LiteLLM publishes rates asdaybreak-*-latest.lookupRatenow 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
lookupRateinusagePricingIntroduces a
LITELLM_RATE_ALIASESmapping sogpt-daybreak-blue-latestandgpt-daybreak-red-latestresolve todaybreak-blue-latestanddaybreak-red-latestpricing entries.lookupRatefirst 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.