Conversation
…overrides - Exclude github_copilot/ prefix from LiteLLM data (subscription-based $0.00 pricing poisons per-token cost estimation) - Inject hardcoded pricing overrides for gpt-5.3, gpt-5.3-codex, and gpt-5.3-codex-spark at $1.75/$14.00 per 1M tokens with $0.175 cache read (sourced from Cursor docs + llm-stats.com corroboration) - Overrides use or_insert_with to avoid clobbering future LiteLLM/OpenRouter entries once they add official API pricing - Add 6 unit tests covering filter, override injection, and lookup Closes #199, closes #172 Refs #204, #205
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f249d32a63
ℹ️ 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".
Overrides were injected as bare keys into the LiteLLM HashMap, which meant exact_match_litellm would return them before OpenRouter entries were checked. If OpenRouter added openai/gpt-5.3-codex with real API pricing, the hardcoded override would shadow it. Now overrides live in a separate fallback_overrides HashMap on PricingService, checked only AFTER both LiteLLM and OpenRouter return no match. Tests verify fallback yields to both LiteLLM bare keys and OpenRouter provider-prefixed entries.
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/core/src/pricing/mod.rs">
<violation number="1" location="packages/core/src/pricing/mod.rs:99">
P2: lookup_with_source now returns fallback pricing even when a specific source is forced, so `lookup_pricing(..., Some("litellm"))` can succeed with a "Fallback" source instead of returning an error. This violates the forced-source contract and can mislead callers.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…per, fix CLI label - Fallback overrides no longer fire when --provider is set; forced source miss correctly returns None (propagates error to CLI) - Extract compute_cost() shared between PricingLookup and PricingService to prevent cost formula drift - CLI now displays 'Fallback' (yellow) instead of mislabeling as OpenRouter - Add test_fallback_skipped_when_force_source_set
Fallback overrides are now checked after prefix matches but before fuzzy matching inside PricingLookup, preventing fuzzy from resolving gpt-5.3-codex to wrong models like gpt-5.1-codex-mini. Also restores doc comments with @keep annotations for non-obvious filtering and priority ordering logic. Closes #204, closes #205
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/core/src/pricing/lookup.rs">
<violation number="1" location="packages/core/src/pricing/lookup.rs:243">
P2: Fallback pricing only checks the raw model_id, so normalized variants (e.g., gpt-5-3-codex → gpt-5.3-codex) won’t match fallback even though version/model normalization is already applied for other sources. Apply the same normalization before fallback to keep behavior consistent.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…n gap Rename all internal "fallback" naming to "cursor" since the data source is Cursor model pricing. Also fix a bug where version-normalized queries (e.g. gpt-5-3-codex → gpt-5.3-codex) would skip Cursor overrides and fall through to fuzzy matching, potentially resolving to wrong models.
…ntified tests openai/gpt-5.3-codex was resolving to perplexity/openai/gpt-4o-mini ($0.00) because exact_match_cursor did not strip provider prefixes. Now extracts the model part after "/" and checks Cursor overrides, matching the existing openrouter_model_part pattern. Added 3 tests for provider-prefix resolution, upstream precedence, and tier suffix stripping.
Pricing Resolution Verification (49/49 models pass)All models used on this machine resolve correctly after the fix. GPT-5.3 edge case coverage:
Edge cases verified:
170 tests pass ( |
Update lookup strategy (now 7 steps), pricing section, and features bullet across all 4 READMEs (EN, KO, JA, ZH-CN) to reflect the new Cursor pricing override layer for models not yet in LiteLLM/OpenRouter.
fix(pricing): GPT-5.3 Codex resolves to $0.00 — filter github_copilot + inject overrides Co-authored-by: Junho Yeo <i@junho.io>
Summary
github_copilot/entries from LiteLLM data — subscription-based $0.00 pricing poisons per-token cost estimation (e.g.github_copilot/gpt-5.3-codex→ $0.00/$0.00)gpt-5.3,gpt-5.3-codex,gpt-5.3-codex-sparkat $1.75/$14.00 per 1M tokens ($0.175 cache read) — sourced from Cursor docs + llm-stats.com corroborationor_insert_with— they won't clobber future LiteLLM/OpenRouter entries once official API pricing lands (LiteLLM PR #20552 pending)Root Cause
tokscale pricing "gpt-5.3-codex"matchedgithub_copilot/gpt-5.3-codexfrom LiteLLM data, which reports $0.00/$0.00 (subscription-based, meaningless for cost estimation). GPT-5.3 Codex is not yet on the OpenAI API, so no legitimate entry exists in either LiteLLM or OpenRouter.Test Results
cargo test— 166 passed, 0 failed, 1 ignored (pre-existing sqlite test)Closes #199, Closes #172, Closes #204, Closes #205, Closes #206
Summary by cubic
Fixes $0.00 pricing for GPT-5.3 Codex by filtering subscription-only GitHub Copilot entries and adding Cursor-priced overrides for the GPT-5.3 family. Docs now explain Cursor pricing as a third lookup source; overrides run after exact/prefix and before fuzzy, and the CLI labels them as Cursor.
Bug Fixes
New Features
Written for commit 4989b0e. Summary will update on new commits.