Skip to content

[0.60.5] Use Codex long-context thresholds for Claude Code - #553

Closed
Finesssee wants to merge 1 commit into
mainfrom
codex/port-0.60.5-claude-gpt-threshold
Closed

Finesssee wants to merge 1 commit into
mainfrom
codex/port-0.60.5-claude-gpt-threshold

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ports upstream cd47c9e (0.60.5) to the Windows cost scanner.

  • Claude Code transcripts that record a known OpenAI/Codex model now use the bundled Codex long-context boundary of 272,000 tokens.
  • The models.dev catalog still supplies the model rates, including the above-threshold rates.
  • Aliases and explicit openai/ routes are covered; unknown OpenAI and non-OpenAI models keep their catalog boundary.
  • Windows scans Claude JSONL directly and does not use the upstream Swift CostUsageStore report memo, so the upstream persisted-report migration has no separate Windows operation.

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • cargo test --manifest-path rust/Cargo.toml cost_pricing::claude --lib -- --nocapture
  • cargo test --manifest-path rust/Cargo.toml cost_pricing --lib
  • cargo test --manifest-path rust/Cargo.toml cost_scanner --lib
  • cargo clippy --manifest-path rust/Cargo.toml --lib -- -D warnings

Upstream reference: cd47c9e

Summary by CodeRabbit

  • Bug Fixes
    • Corrected long-context token thresholds for supported OpenAI Codex models when calculating Claude-related pricing.
    • Preserved catalog-provided rates and boundaries for unknown OpenAI models and non-OpenAI providers.
    • Ensured model aliases and explicitly routed models use consistent threshold handling.
  • Tests
    • Added coverage for supported Codex models, aliases, explicit routes, and cases that should retain catalog thresholds.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4b08c844-bf2f-46a3-bc7f-5a50cd10856e

📥 Commits

Reviewing files that changed from the base of the PR and between 10e3b09 and 1ad465c.

📒 Files selected for processing (2)
  • rust/src/core/cost_pricing/claude.rs
  • rust/src/core/cost_pricing/codex.rs
 ____________________________________________
< This is what it sounds like when bugs cry. >
 --------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Closing this duplicate port PR because existing PR #546 already carries the Windows equivalent of upstream cd47c9e, including Claude routed pricing and long-context threshold coverage. Keeping one authoritative Claude parity PR avoids overlapping implementation and review paths.

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