fix(cli): derive catalog price estimates for models without manual overrides - #6026
codingbooo wants to merge 1 commit into
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe CLI now displays estimated input and output prices for configured models. Its price query reports both saved manual costs and effective costs, including matched estimates when no manual override exists. Tests and documentation describe price precedence, zero-cost overrides, and unknown prices. ChangesCLI model pricing
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change adds estimated prices while retaining manual overrides and unknown-price handling. No actionable merge-blocking risk is established by the supplied review evidence. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Model prices become visible through existing CLI commands, with manual overrides taking precedence. The review found no new privileged access path or change to how prices are saved, but coverage is incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 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 |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request has been marked Ready for Review. |
리뷰 · 우선순위 40 / 80이 PR은 직접 적은 가격이 있으면 그 값이 이깁니다. 0도 직접 적은 값입니다. 가격표에도 없고 직접 적은 값도 없으면 화면은
라인 - 라인 - 메인테이너의 판단이 필요한 지점 이슈 #5960은 단가가 비어 있어 하나씩 적기 귀찮다는 글입니다. 이 PR은 설정에 가격을 써 넣지 않습니다. 읽을 때만 추정값을 붙입니다. CLI 목록으로 이슈를 닫을지 정해 주세요. 대시보드 가격 창( 중계 제공자에는 공식 회사 가격이 붙습니다. 테스트는 너의 추천 방향은 맞으니 목록 문구만 고치고 머지하면 됩니다. 저장한 가격에는 물결표를 빼거나 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
Exact-head review at e1b73f2: the derivation and precedence logic are sound, but the human models listing does not preserve the advertised source distinction. src/cli/models.ts renders every available price with the same tilde form, including explicit user overrides and intentional zero prices. Thus a saved authoritative rate is presented as an estimate, and the focused human-output test only asserts the automatic row. Render automatic estimates and saved overrides differently, add assertions for both (including zero), and then obtain executable exact-head CI. Also confirm whether issue 5960 refers to this CLI surface before claiming the still-blank dashboard price editor is fixed.
|
Landed on |
…errides (lidge-jun#6026) Carried from lidge-jun#6026 into merge train round 3. Co-authored-by: codingbo <cnsdbo@163.com>
Closes #5960
What
ocx modelsshowed a blank or—price column for every catalog model that had no manualprice override in the config, even when the catalog itself advertises pricing metadata. Users
read that as "pricing is broken" rather than "no override is configured".
The CLI now derives a price estimate from the catalog entry when no manual override exists, and
labels it as derived so an authoritative override is never mistaken for it. An explicit override
still wins, and a model with neither source still reads as unknown rather than as free.
Scope
src/cli/models.ts,src/cli/models-runtime.ts— derive the estimate from the catalog entry.docs-site/src/content/docs/reference/cli/providers-accounts.md— describe the derived/overridedistinction.
tests/cli/cli-models-price.test.ts,tests/cli/cli-models.test.ts— cover derived, override andunknown cases.
Verification
bun run typecheckcleanbun test tests/cli/cli-models-price.test.ts tests/cli/cli-models.test.ts— passingbun run structure:check,bun run privacy:scan— cleanReview readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
null.