pricing: a non-USD unit on a hostless or "*" block unprices the bundled table everywhere

已关闭 适合新手
#1,190 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
backend, testing

调研方向

先从现有的仅针对 multiplier 的拒绝逻辑旁边的启动配置验证开始,然后检查 TestConfig_AUnitOnAMultiplierOnlyBlockIsRefused。为无主机或 "*" block 中的非 USD 单位添加一个表格行或相邻用例,并确认启动时会拒绝它。

由索引模型根据 Issue 内容生成。

描述

Found by an independent review of #1153 at 80348bfc (and raised by pdettori there as a suggestion); deferred by the author's call.

After #1153 a unit is host-wide, and only rows in an endpoint's unit may price its traffic. A block with unit: and no hosts: (or hosts: ["*"]) covers every endpoint, so every endpoint no more specific block names takes that unit — and the bundled dollar table stops pricing anything there.

Measured at 80348bfc with hosts: ["*"], unit: credits, models: {premium-ide} and the bundled table on:

api.anthropic.com  claude-opus-4-1   unit=credits  prov=none

At a66911e9 the same request was unit=USD prov=bundled. The unpricing is loud (unpricedBy names every pair); the other half is silent: a charge any of those endpoints reports itself is labelled credits.

Shape of a fix

Refuse a non-USD unit: on a hostless or "*" block at startup, beside the multiplier-only refusal — a unit is a gateway's, so its hosts should be named — with one row added to TestConfig_AUnitOnAMultiplierOnlyBlockIsRefused's table or a sibling.

Assisted-By: Claude (Anthropic AI) [email protected]

主要语言
Go
星标
23
派生
44
平均合并
16 小时 32 分钟
30 天内合并 PR
227

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rossoctl/cortex 的其他 Issue

查看 rossoctl/cortex 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。