codex-usage v2.6.0
Pre-releasecodex-usage v2.6.0
此版本保留为预发布记录:合并后的重复检查发现 macOS Intel 存在退出时序问题,可能导致卸载/更新误报 PID 不匹配。请使用修复此问题的 v2.6.1 或后续稳定版。
修复计量与查询一致性,新增主任务/子任务树及 macOS 安装分发。
- Turn 累计计量:区分 Session 与 Turn 累计,新 Turn 数值小于、等于或大于上一 Turn 都可正确计量;保留旧格式、fork 排重、模式分类和分类修正。
- 可靠入账:事件、模式、累计进度和文件游标原子提交;存储错误回滚并保留重试位置,半行 JSONL 不会被提前跳过。
- 跨进程刷新:数据库版本号随事务持久化;任务与费用使用一致快照,本机价格配置变化也能使缓存失效。
- 搜索与查询:搜索确定任务后,用相同筛选范围计算 Token 与费用;先选任务、聚合事件再关联元数据。相同 114,960 条事件快照的三轮本机比较,列表中位耗时 2.75 s → 0.43 s,任务费用接口 3.12 s → 0.83 s(均未命中应用缓存)。
- 统一时区:计量时区保存在数据库并显示在页面底部;异地浏览器按服务端日期和真实小时边界显示,支持夏令时重复小时与 23/25 小时日期。
- 任务树:明细支持列表/树切换、折叠、根任务分页、本任务及含子任务用量;仅使用明确的父子元数据,fork 来源单列,缺失父任务或循环关系会明确提示。
- macOS:新增 Apple Silicon / Intel 单文件程序、用户 LaunchAgent 安装卸载、浏览器打开及可选更新;原有 Windows / Linux 与 Fast 费用功能保留。
- 发布构建更新为 Go 1.26.8,产物为六个平台程序与
SHA256SUMS。中英文、浅深色、窄屏和合成 Demo 同步更新。
历史数据保留: 升级不会自动重算旧账。本次计量修复对新增记录生效;若要修正旧版本已经漏计的历史,需要先备份并核对源 JSONL 覆盖,再显式运行 codex-usage scan --rebuild。源文件已删除的历史不能靠重建恢复。旧 Session 出现在新的物理文件且无法验证排重边界时,会请求确认重建。
macOS 程序未经 Apple Developer ID 签名/公证;请核验校验和,参见 macOS 安装说明。无需也不建议全局关闭 Gatekeeper。
详见 计量、任务树与验证说明。现有 v2.5.0 安装可从“软件更新”选择升级。
Fix accounting and query consistency; add task trees and native macOS installation.
- Distinguish session and turn cumulative counters, including smaller/equal/larger first snapshots; preserve legacy writers, fork deduplication, Fast attribution and classification corrections.
- Commit events, modes, progress and file offsets together. Database failures roll back and retry; incomplete JSONL prefixes remain unread until complete.
- Persist cross-process data revisions and use consistent session/cost snapshots. External pricing changes invalidate caches. Search and costs use the same filtered session scope.
- Aggregate only paged sessions before joining metadata. Three local cache-miss runs on the same 114,960-event snapshot reduced median session-list latency from 2.75 s to 0.43 s and session-cost latency from 3.12 s to 0.83 s.
- Persist the accounting time zone; use real hour identities for remote browsers, DST repeated hours and 23/25-hour days.
- Add collapsible, paginated task trees with own and subtree usage, explicit parent metadata, separate fork lineage and visible orphan/cycle handling.
- Add macOS Apple Silicon / Intel binaries, per-user LaunchAgents, uninstall, browser opening and optional updates. Build six platform binaries and checksums with Go 1.26.8.
History stays intact. New accounting applies to newly read records. Historical recalculation requires an explicit scan --rebuild after verifying retained JSONL coverage and backing up the state; deleted sources cannot be recovered by rebuilding. macOS binaries are not Developer-ID signed or notarized. See the linked installation and accounting notes for contracts and validation boundaries.