fix(opencode): resolve provider model pricing aliases#983
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe pull request adds a required ChangesProvider-aware cost calculation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
@ccusage/amp
ccusage
@ccusage/codex
@ccusage/mcp
@ccusage/opencode
@ccusage/pi
commit: |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | ba407ff | May 11 2026, 10:11 PM |
Preserve OpenCode provider IDs in loaded usage entries and try provider-aware pricing candidates when calculating costs. Normalize Claude minor-version model IDs such as claude-opus-4.7 and claude-opus-41 algorithmically so new variants do not require one-off aliases.
03c15eb to
ba407ff
Compare
Replaces one-off OpenCode model aliases with provider-aware pricing resolution.
OpenCode records providerID and modelID from its models.dev-backed model metadata. This preserves providerID in loaded entries, normalizes Claude minor-version IDs such as claude-opus-4.7 and claude-opus-41 algorithmically, and tries pricing candidates in an order that avoids zero-cost provider metadata when a canonical LiteLLM model price exists.
This supersedes #868.
Testing:
Summary by CodeRabbit
Bug Fixes
Data
Tests