name
ff6f1640c4
fix(channels): 后端按次/图片计费跳过 token 区间重叠校验
前端在上一个 commit 已对 image / per_request 模式跳过 unbounded-last
和重叠检查, 但保存时后端仍按 token 语义校验, 导致添加第二个图片层级
时报错:
invalid pricing intervals for platform 'openai' models
[gpt-image-2 gpt-image-1.5 gpt-image-1]:
interval #1: unbounded interval (max_tokens=null) must be the last one
ValidateIntervals 加 mode 参数, 与前端校验逻辑对齐:
- token 模式行为不变 (区间重叠 / last-unlimited 仍校验)
- per_request / image 模式跳过区间重叠和 last-unlimited 检查,
保留单条 min/max 自洽校验与价格非负校验。
调用方 validatePricingIntervals 把 pricing.BillingMode 透给校验器。
既有单测全部加上 BillingModeToken 显式参数, 新增 3 个 image 模式用例
(允许多条 unbounded / 仍拒绝负价 / 仍拒绝 max <= min)。
2026-05-15 13:14:07 +08:00
..
2026-05-11 15:30:51 +00:00
2026-05-06 17:19:20 +08:00
2026-05-15 13:14:07 +08:00
2026-05-07 10:07:28 +08:00
2026-03-19 19:03:13 +08:00
2026-01-11 23:00:31 +08:00
2026-03-07 15:17:16 +08:00
2026-05-08 14:42:20 +08:00
2026-05-08 14:42:20 +08:00
2026-05-08 14:42:20 +08:00
2026-02-28 15:01:20 +08:00