Repository navigation
fix(usage): 免费 Fast 费用明细使用请求时 Standard 客户单价 - #864
Merged
Merged
Conversation
ranxi2001
marked this pull request as ready for review
November 15, 2026 13:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题与行为变化
Free Fast 已按 Standard 扣费,但费用明细此前使用 Priority 成本字段,不能解释客户实付。现在保存该次 Standard 计算的只读报价快照,既有费用明细按快照显示单价、缓存 TTL 单价、倍率前分项及合计。实际扣费、账本、Priority 原始成本和真实 Fast 档位保持原行为。
关联记录与来源
基线
production@0e8e97aa23afd8e88a61ea64a84a8fb84f1bfdc6;无外部源码引入。最终 headfe741b779b761257a96d187f9f52854e6934c27b。管理员新功能提示
不适用:既有费用明细 bugfix,无新入口、badge、banner 或标签。提示 ID、展示位置、关闭状态、A→B、多入口同步、刷新/登录和后续 C 验收均不适用。
复现与验收
使用合成 fixture:输入 8345、输出 136、30m 写入 1197、缓存读取 37469。Standard 分项合计 0.14268150,乘请求时有效倍率 0.50 为 0.07134075;档位仍 Fast。混合 TTL fixture 分别保留读取、30m、12h 的实际已解析单价,不把缓存写入统一除以二。覆盖用户/管理员、中英文、桌面/移动的真实共享组件。
计费与持久化补充
只有实际采用 Free Fast Standard 重算时捕获快照;个人/组/高峰/模型倍率取同次计算参数,推理和上下文调整已在组件费用内。版本2保存各缓存桶单价;版本1金额保留、单价未知。无快照不从当前价卡或分组开关倒推。旧完整 token-only Priority 明细无法解释实际金额时保守显示未知;无快照的图片/按次/附加费用不强行分摊。
不改变模型协议、调度、重试、并发及实际账务。durable replay 保留首次事件快照及原单次扣款幂等语义。
实际验证
git diff --check通过;未运行本地动态测试、生产迁移、模型请求、退款或部署。兼容性与运行影响
新增可选只读
customer_cost_details,版本2。379_usage_customer_cost_details.sql仅增加 nullable JSONB,无历史回填、无改价;旧二进制忽略该列,回退不会删除快照。受限管理员只增加定型数值快照,权限白名单不开放嵌套用户/Key/账号资料。快照不作为计费输入,不修改原 Priority 成本列或账号统计。文档与用户可见变化
费用明细直接使用请求时 Standard 报价,无新说明标签。
docs/screenshots/free-fast-customer-cost-details.md记录限制、数学和真实组件证据流程。源码合并不等于部署。Agent 使用声明
原实现与前序修复:Codex CLI,原交接声明
gpt-6-astra/xhigh;Hermes 协调与证据核对声明gpt-6.1-sol,推理强度未知。本轮无法独立追溯其配置。本轮接手:Codex,环境标识 GPT-6,完整模型 ID 与推理强度未知(接口未暴露);参与源码独立复核、原始 CI/图片证据核对和合并。子 Agent 因任务正文被网关省略未开展审查,不计为验证证据。
提交前自查
新增原生截图证据
32 张真实共享组件合成 fixture 截图,capture head=
0581d44caadf429c2d4bcdd67841fde030873efe;before baseline=0e8e97aa23afd8e88a61ea64a84a8fb84f1bfdc6。manifest complete=true/errors=[];32 本地 SHA256 逐一匹配,32 个原生附件已逐一下载并比对相同 SHA256。移动端等待真实 dialog transition 完成,未修改或伪造画面。原 16 张附件、原 capture identity 和本地字节保持不变;本节为新增矩阵,不把原图冒称新截图。原始精确费用 fixture(16 张:8 before / 8 after)
混合 30m/12h 写入 fixture(16 张:8 before / 8 after)
补充 Agent 披露:Hermes Agent /
gpt-6.1-sol/ 推理强度未知(运行环境未提供),参与独审交接、delta/证据检查、截图视觉审阅和原生附件上传及本段正文;代码仍由原唯一 Codex writer /gpt-6-astra/xhigh编写。该历史段提交时独立复审未完成;当前已完成,见顶部权威状态。