Repository navigation
test(billing): fix websocket rejection refund test after pre-consume dropped output estimation - #7491
Conversation
…dropped output estimation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe rejected-token refund test now uses request-priced billing. Its pre-upstream quota assertion changes from 2990 to 2000 to match the 1000-quota reservation. ChangesWebSocket billing test
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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. A rabbit checks the quota with care Comment |
…dropped output estimation (QuantumNous#7491)
…dropped output estimation (QuantumNous#7491)
…dropped output estimation (QuantumNous#7491)
…dropped output estimation (QuantumNous#7491)
…dropped output estimation (QuantumNous#7491)
🔗 关联任务 / Related Issue
测试回归
🚀 变更类型 / Type of change
📝 变更描述 / Description
main 上
TestResponsesWebSocketInitialUpstreamRejectionRefundsReservation现在必挂(expected 2990 / actual 3000)。9978ee1e2之后预扣只按输入算,relay/helper/price.go的 tiered 分支固定传C: 0,不再用max_tokens估输出。这个测试用的表达式是tier("output", c * 2),预留因此恒为 0,断言"上游拒绝前已预留额度"就落空了。只改测试:表达式换成
tier("request", fixed(0.002)),断言 2990 → 2000。请求计价在预扣时是确定值,测试原本要保护的契约(上游拒绝前已预留、拒绝后退款回滚)没变。📸 运行证明 / Proof of Work
在
upstream/main(9a0be8750) 干净 worktree 上验证。改之前,复现失败:
改之后,单测通过:
整包通过:
✅ 提交前检查项 / Checklist
Summary by CodeRabbit