sub2api icon indicating copy to clipboard operation
sub2api copied to clipboard

OpenAI Codex 5h 用量语义可能已变化,当前 100-raw 处理会把 used% 反转

Open Trirrin opened this issue 6 months ago • 0 comments

问题描述

当前代码在处理 Codex 5h 用量时,会固定执行 100 - raw,默认把 5h 原始值视为 remaining%。

但根据当前实际验证,OpenAI/Codex 上游返回的 5h 值现在更像是 used%,继续做 100 - raw 会把正确值反转成错误值。

结果就是:

  • 5h 用量展示会反
  • codex_5h_used_percent 会被写错
  • 依赖该字段的阈值/调度逻辑也可能一起出错

建议

重新确认当前 upstream 对 5h 字段的真实语义。 如果现在返回的是 used%,则应移除现有的固定反转逻辑,而不是继续假设 5h 一定是 remaining%。

Trirrin avatar Jun 01 '26 16:06 Trirrin