Skip to content

codex-usage v2.7.0

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Sep 16:44
e406329

codex-usage v2.7.0

新增精确到分钟的自定义时间范围查询。在“概览 → 自定义”输入开始、结束时间,点击“查询用量”,即可查看区间内的总 Token、未经缩写的精确总量及 API 等价成本。“现在”快捷按钮会将结束时间填为当前分钟,再次查询后生效。

  • 按用量记录的时间截取,支持跨天、零用量和任意跨度;开始时刻包含在内,结束时刻不包含在内。
  • 输入使用数据库保存的计量时区,远程浏览器的时区不会改变查询范围。夏令时重复分钟取首次出现,不存在的分钟会报错。
  • 校验必填项和起止顺序;修改输入后保留上次查询结果,并提示再次查询。桌面、手机和中英文界面均支持。
  • API 的 since / until 新增 YYYY-MM-DDTHH:mm 格式,继续支持带偏移的 RFC3339。费用接口的 fill_days=0 可跳过零用量日期补齐,避免超长跨度的日历限制。缺少时间戳的记录不归入指定时间范围。

本次沿用 schema v11,从 v2.6.4 升级无需为此功能重建历史。更早版本尚未完成的历史核对仍遵循既有显式确认流程。Token 与费用仍为本机日志统计和 API 等价估算。

验证包括 Go 测试、静态检查、25 项 Dashboard / synthetic Demo 浏览器测试,以及独立统计库上的 API、页面和 SQL 求和对照。回归覆盖跨午夜、相邻区间边界、夏令时、浏览器与计量时区不同、零用量、任意跨度和精确总量显示。


Add minute-precision custom time ranges. In Overview → Custom, enter start and end times and select Query usage to view total tokens, the unabridged total, and API-equivalent cost. Now fills the end time with the current minute; query again to apply it.

  • Filter individual usage events across dates and arbitrary spans, including empty intervals. Start is inclusive; end is exclusive.
  • Interpret inputs in the ledger's accounting timezone, independently of the browser timezone. Repeated DST minutes use the first occurrence; nonexistent minutes return an error.
  • Validate required inputs and time order. Edited inputs preserve the previous results until the next query. Support desktop, mobile, Chinese and English interfaces.
  • Accept YYYY-MM-DDTHH:mm for API since / until, alongside RFC3339 with an explicit offset. The cost endpoint supports fill_days=0 to avoid zero-filled calendar limits for long spans. Exclude undated records from time-bounded queries.

Schema v11 is retained. Upgrading from v2.6.4 requires no history rebuild for this feature; outstanding historical corrections from older versions retain their explicit-approval workflow. Totals remain local-log usage and API-equivalent estimates.

Validation covers Go tests, vet, 25 Dashboard / synthetic Demo browser tests, and API/UI totals checked against independent SQL sums on an isolated ledger. Regressions cover midnight, adjacent boundaries, DST, remote browser timezones, empty intervals, unrestricted spans and exact totals.