Releases: zJay26/codex-usage
Release list
codex-usage v2.6.3
codex-usage v2.6.3
修复 v2.6.0–v2.6.2 在历史重扫中可能大幅多计 Token 的累计范围回归。
- 逐个 Turn 核对累计边界:一次重置不再使后续所有 Turn 都从零计数;连续累计和新 Turn 重发的旧快照均保留正确基线。
100/100 → 20/20 → 50/30(累计值/本次增量)现在合计 150,修复旧版算成 170 的问题。 - 跨扫描一致性:即使记录没有新增 Token,也保存其累计解释,避免下一次扫描重新继承旧范围;分类修正仍回到原有事件。
- 明确不确定边界:重置后若缺少快照,无法区分连续累计与再次重置,保守按差值计量并提示可能缺少用量,不再仅凭旧范围推断。
- 旧账修复提示:schema v9 的现有统计升级到 v10 后保留事件和游标、立即显示核对提示并暂停增量扫描,等待显式重建。空数据库无需修复;从 v2.5.0 直接升级保留原有迁移行为。
- 更新中英文 README、重建对话框和计量技术说明,保留 v2.6.2 的更新包下载目录设置。
升级后修正历史: 先备份并确认源 JSONL 仍齐全,再在 Dashboard 点击“重新扫描 → 同意并重建”,或运行 codex-usage scan --rebuild。仅更新程序不会自动消除已入库的多计记录;已删除源文件的历史无法通过重建恢复。
验证: 固定同一时点的 766 个 rollout,提取计量所需的数值、metadata 和 Turn 边界后在隔离目录重建;742 个有用量会话与逐会话参考值完全匹配,总量由 19,646,071,899 修正到 14,941,760,325,消除 23 个会话的 4,704,311,574 重复 Token。独立核对覆盖了变化会话的原始记录,未变化会话沿用快照参考值;这不是所有历史的独立审计或账单验证。再次扫描新增事件为 0,总量不变。
回归覆盖真实数值向量、混合累计、重复快照、分类修正、扫描重启、缺失快照、旧库保留和 API 确认重建。完整平台及 Dashboard 检查通过后发布六个平台程序与 SHA256SUMS。
Fix a counter-scope regression in v2.6.0–v2.6.2 that could substantially overcount tokens during historical rescans.
- Evaluate each turn boundary independently. One reset no longer causes every later turn to count the entire cumulative total again. Continuations and repeated old snapshots retain their baseline. The
total/lastsequence100/100 → 20/20 → 50/30now correctly totals 150 instead of 170. - Persist the interpretation of duplicate snapshots across scans and keep classification corrections attached to the original usage.
- Mark incomplete boundary evidence conservatively instead of inferring another reset from an earlier one.
- Migrate schema v9 to v10 without deleting history. Existing JSONL ledgers immediately show a rebuild notice and pause incremental ingestion until an explicit rebuild. Empty stores need no repair; direct v2.5.0 upgrades retain the earlier migration behavior.
- Update both READMEs, the rebuild dialog, and accounting documentation. Retain v2.6.2 download-directory settings.
Repair stored history after upgrading: back up and verify retained JSONL coverage, then choose Rescan → Approve and rebuild or run codex-usage scan --rebuild. Updating the binary alone does not fix stored overcounts, and rebuilding cannot recover deleted source files.
Validation: an isolated rebuild of accounting-only projections from 766 frozen rollouts matched reference totals for all 742 sessions with usage. The total changed from 19,646,071,899 to 14,941,760,325, removing 4,704,311,574 repeated tokens across 23 sessions. Changed sessions were independently reconciled against their source records; unchanged sessions retained snapshot reference totals. This is not an independent audit of all history or a billing reconciliation. A repeated scan inserted zero events and left totals unchanged. Regression coverage includes mixed counters, duplicate snapshots, corrections, restarts, missing evidence, migration preservation, and the API approval flow.
codex-usage v2.6.2
codex-usage v2.6.2
支持在软件中配置更新包下载目录,方便查找和保留安装包。
- “软件更新”新增下载目录设置,支持保存、恢复默认、打开文件夹和复制路径。
- 默认使用用户下载目录下的
codex-usage文件夹;Windows 支持系统下载文件夹重定向。 - 下载包按版本分目录保存,界面显示最近下载文件的完整路径。更改目录只影响未来下载,已有文件保留在原处。
- 保存和下载前检查目录是否可写;更新进行中不能切换目录。安装前仍会校验 SHA256,并使用私有副本执行安装;程序和数据库备份继续保留在本机状态目录。
- 同步中英文界面、窄屏布局及合成演示。更新仍由用户选择,不强制下载安装。
已安装 v2.5.0 或更新版本的用户,可在“软件更新”中检查并选择升级。新目录设置在升级完成后可用。
Configure the update download directory inside the application.
- Software updates now offers a directory setting, Save, Use default, Open folder, and Copy path.
- Defaults to
codex-usageinside the user's Downloads directory, honoring redirected Windows Downloads folders. - Keeps release binaries in version folders and displays the last download's full path. Changes apply only to future downloads; existing files stay in place.
- Validates directory access before saving and downloading, prevents directory changes during an update, and verifies a private installer copy before application. Program and database backups remain in the local state directory.
- Includes English/Chinese UI, mobile layouts and synthetic demo support. Installation remains optional and requires the user's choice.
Installed v2.5.0 or later can check for and select this release in Software updates. Directory settings become available after upgrading.
codex-usage v2.6.1
codex-usage v2.6.1
修复计量与查询一致性,新增主任务/子任务树及 macOS 安装分发。
此稳定版包含 v2.6.0 的全部功能,并修复原生重复检查发现的 macOS 退出时序问题:launchd bootout 后等待原进程退出,将僵尸进程和已被复用的 PID 视为原进程已结束,避免再次向该 PID 发送信号或误报安装路径不匹配。CI 和 Release 均在两个 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.
This stable release includes all v2.6.0 features and fixes a macOS shutdown race found by repeated native checks. After launchd bootout, wait for the original process to exit; treat zombies or a reused PID as the original process having ended, without signalling the new PID owner. CI and release gates repeat the install/uninstall/reinstall cycle three times on both Mac architectures.
- 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.
codex-usage v2.6.0
codex-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.
codex-usage v2.5.0
codex-usage v2.5.0
新增可选的软件自动更新:默认每 6 小时检查 GitHub 最新稳定版,只提示,不强制下载或安装。
- 页面底部新增“软件更新”,发现新版本时显示可关闭的提示。支持查看发布说明、“稍后”、手动检查和关闭自动检查。
- 用户点击“下载并更新”后才开始下载;按 Windows / Linux、amd64 / arm64 选择对应文件,校验 SHA256 后更新并重启。
- 安装前备份程序、配置及 SQLite 账目。新版本启动失败时尝试恢复旧程序和数据,界面显示更新或恢复结果。
- 更新过程保留已有统计,不因源 JSONL 已被删除而重建账目。更新检查不上传用量、路径或对话。
- 同步中英文文案、浅色 / 深色主题、窄屏界面及纯合成演示。
从 v2.4.1 或更早版本升级,仍需手动下载并执行一次 install。安装 v2.5.0 后,后续版本即可在软件内选择更新。 便携版及预览版提供版本检查和发布页链接。
备份位于本机状态目录下的 .codex-usage-updates/run-*,不会自动删除。GitHub 不可达或下载校验失败时,当前版本继续使用;更新安装期间服务会短暂重启。
Optional in-app updates: check automatically, install only when you choose.
- Checks GitHub's latest stable release every six hours; offers release notes, Later, manual checks, and an automatic-check opt-out.
- Downloads only after Download and update, selects the matching Windows / Linux and amd64 / arm64 binary, and verifies SHA256 before installation.
- Backs up the program, configuration and SQLite ledger, then replaces and restarts. A startup failure triggers an attempt to restore the previous version and data.
- Preserves historical statistics even when source JSONL files are no longer present. Version checks do not upload usage, paths, or conversations.
- Includes English / Chinese, light / dark themes, mobile layouts, and an offline synthetic demo.
Users of v2.4.1 and earlier must download and run install once. After installing v2.5.0, future upgrades can be selected inside the application. Portable and preview copies provide checks and release links. Local backups remain in .codex-usage-updates/run-*; installation briefly restarts the service.
codex-usage v2.4.1
codex-usage v2.4.1
统一以总 Token 展示用量,并精简 Fast 模式界面。
- 概览主数字改为总 Token,下方以小字显示常规 / Fast;小时和每日趋势、月历、模型列表、任务明细统一显示总量与 Fast。
- 模式未确认用量直接归入常规,移除界面中的未确认提示和筛选选项。底层模式证据及导出元数据继续保留。
- 费用标题简化为“API 等价成本”,用一句话说明 API 价格和 Fast 额度规则各自的更新日期。
- 移除费用卡片的折算详情展开区,保留常规和 Fast 费用拆分及定价覆盖率。
- 修复任务列表长路径溢出到相邻列的问题,同步中英文和窄屏布局。
计数账目、模式识别、费用算法与 API 兼容性保持不变。本次更新无需数据库重建。
验证:18 项 Playwright 测试通过;真实数据独立副本完成桌面、窄屏和任务列表检查。
Show total tokens consistently and simplify the Fast mode interface.
- Make total tokens the primary overview metric, with regular / Fast below. Hourly/daily trends, calendars, models, and sessions now show total and Fast usage.
- Include unconfirmed mode usage in regular totals without separate UI notices or a dedicated filter. Retain underlying evidence and export metadata.
- Shorten the heading to API-equivalent cost and show API price and Fast credit rule update dates in one sentence.
- Remove the expandable calculation details while retaining regular/Fast cost splits and pricing coverage.
- Prevent long session paths from overflowing adjacent columns, with matching English/Chinese and narrow layouts.
The token ledger, mode detection, pricing algorithm, and API compatibility are unchanged. No database rebuild is required.
Validation: 18 Playwright tests passed; desktop, narrow-screen, and session views were checked against an isolated copy of real data.
codex-usage v2.4.0
codex-usage v2.4.0
新增 Fast 模式用量统计与费用折算。
- 按 turn 区分常规、Fast 和模式未确认的用量。常规为主要指标;未确认部分明确标注并暂归常规,Fast 原始 token 不乘倍率。
- 从 JSONL 明确字段或同一 Codex Home 的诊断记录精确关联模式,后台补齐仍有证据的历史。v2.3.7 升级采用增量迁移,不重建原始 token 账目。
- 概览、小时/每日趋势、模型与任务明细支持模式拆分,筛选统一作用于统计、费用及 JSON/CSV 导出。
- 新增“API 等价成本(含 Fast 折算)”:在 Standard API 基础估算上,Astra、GPT-5.6 Sol/Terra/Luna、GPT-5.5 的 Fast 用量按 2.5 倍折算,GPT-5.4 按 2 倍折算。未知单价或倍率保留为未定价。
- 费用详情保留常规、Fast、Standard 基础费用及新增折算金额。旧费用 API 调用默认保持 Standard 基础估算;新界面显式请求 Fast 折算口径。
- 同步中英文、浅深色主题、窄屏布局和合成演示数据。
历史模式覆盖率取决于仍保留的本地证据。统计表示 turn 请求选择的模式;费用折算不代表实际 API 账单或账号额度扣除。倍率规则核对于 2026-09-07。
验证:Go 测试、go vet、18 项 Playwright 测试通过;独立数据库副本的历史补齐保持原始账目哈希一致。
Fast mode usage accounting and cost adjustment are now available.
- Classify usage by turn as standard, Fast, or unconfirmed. Regular tokens remain the primary metric and include clearly labeled unconfirmed usage. Raw Fast tokens are never multiplied.
- Backfill retained historical evidence using explicit JSONL fields or exact session/turn matches in read-only diagnostics from the same Codex Home. Upgrading from v2.3.7 uses an additive migration without rebuilding the token ledger.
- Split overview, hourly/daily trends, model and session details by mode. Mode filters apply to statistics, costs, and JSON/CSV exports.
- Add API-equivalent cost with Fast adjustment: Standard base estimates use a 2.5x ChatGPT Codex credit factor for Astra, GPT-5.6 Sol/Terra/Luna, and GPT-5.5, or 2x for GPT-5.4. Missing rates or factors remain unpriced.
- Retain regular/Fast totals, Standard base estimates, and the Fast surcharge. Existing cost API calls default to Standard estimates; the Dashboard explicitly requests the new basis.
- Update English/Chinese text, light/dark themes, narrow layouts, and synthetic demo data.
Historical coverage depends on retained local evidence. Modes describe the turn's requested setting; adjusted estimates are neither actual API bills nor account credit deductions. Factor rules were verified on 2026-09-07.
Validation: Go tests, go vet, and 18 Playwright tests passed. Backfill on an isolated database copy preserved the original ledger hash.
codex-usage v2.3.7
codex-usage v2.3.7
v2.3.7 recognizes newer Codex per-turn token counter restarts and stops showing resolved historical warnings as active red alerts.
- Treats a restarted
total_token_usagethat exactly matcheslast_token_usageas a complete, exact increment. These normal new-turn boundaries no longer creategap_fallbackevents or data-quality warnings. - Keeps a distinct actionable warning when a cumulative boundary cannot be fully verified and only a conservative
last_token_usagefallback is possible. - Excludes legacy
cumulative_resethistory from the active warning count without deleting its audit rows. - Automatically removes stale file-rewrite or truncation warnings after a later scan successfully reconciles the same JSONL path.
- Preserves all existing Token totals and source JSONL files. No automatic historical rebuild is performed or required for this update.
v2.3.7 识别新版 Codex 按 Turn 重置 Token 累计值的行为,并停止把已经恢复的历史记录持续显示为红色告警。
- 当重置后的
total_token_usage与last_token_usage完全一致时,将其作为完整、精确的本次增量处理;正常的新 Turn 边界不再产生gap_fallback或数据质量告警。 - 如果累计边界确实无法完整核对、只能使用
last_token_usage保守补位,仍会生成单独的可处理告警。 - 旧版
cumulative_reset记录继续保留在本机数据库中作为审计历史,但不再计入当前红色告警数量。 - JSONL 文件改写或截断问题经后续扫描确认恢复后,对应的过时告警会自动清除。
- 保留现有全部 Token 统计和源 JSONL;本次更新不会自动执行,也不要求执行历史重建。
codex-usage v2.3.6
codex-usage v2.3.6
v2.3.6 adds Standard API-equivalent cost analysis for GPT-6 Astra while preserving every existing model price.
- Recognizes
gpt-6-astrausage and prices it at the published Standard text-token rates per 1M tokens: $10.00 Input, $1.00 Cached Input, $12.50 Cache Write, and $50.00 Output. - Shows GPT-6 Astra in the Dashboard pricing catalog and makes it available as a built-in target for local model aliases.
- Adds focused regression coverage for model resolution, all four token-price categories, total cost, and complete pricing coverage.
- Updates the Chinese and English pricing references plus the synthetic demo catalog. Existing built-in model rates are unchanged.
- Cost remains a local Standard API-equivalent estimate, not an OpenAI bill or account quota. As before, the estimator does not infer per-request long-context multipliers from cumulative local JSONL activity.
v2.3.6 新增 GPT-6 Astra 的 Standard API 等价成本分析,并保持所有现有模型价格不变。
- 识别
gpt-6-astra用量,并按官方公布的 Standard 文本 Token 单价估算:每 100 万 Token 的 Input 为 $10.00、Cached Input 为 $1.00、Cache Write 为 $12.50、Output 为 $50.00。 - 在 Dashboard 内置价格目录中显示 GPT-6 Astra,并允许本机内部模型将其选作明确的价格别名目标。
- 新增针对模型识别、四类 Token 单价、总费用和完整定价覆盖率的回归测试。
- 同步更新中英文价格说明与合成演示目录;其他内置模型单价均未修改。
- 费用仍是本机 Standard API 等价估算,不代表 OpenAI 账单或账号配额;与既有口径一致,工具不会从累计 JSONL 活动中推断逐请求长上下文倍率。
codex-usage v2.3.5
codex-usage v2.3.5
v2.3.5 fixes a remaining replay-accounting edge case for modern fork rollouts that copy a parent transcript before the child task starts.
- Pending modern forks remain pending across scans even when the JSONL file does not grow. Copied parent snapshots are no longer read from offset zero and charged as child usage.
- Added a regression test covering an unchanged pending fork followed by the real child continuation.
- The derived-data schema is now v7. Existing databases are preserved and require an explicit historical rebuild so previously indexed replay rows can be removed from the derived ledger.
- Source JSONL files are never modified. Token totals remain local JSONL accounting, not an OpenAI bill or account quota.
v2.3.5 修复现代 fork rollout 在子任务尚未开始、但父会话历史已经复制完成时的剩余统计缺陷。
- 即使 JSONL 文件大小没有变化,待定的现代 fork 也会持续等待 replay 边界,不再从 offset 0 读取并把父历史计入子会话。
- 新增“待定 fork 在文件不增长时再次扫描、随后追加真实子任务”的回归测试。
- 派生数据 schema 升至 v7。已有统计库会保留原数据并要求明确执行历史重建,以移除此前已经写入的 replay 重复行。
- 源 JSONL 不会被修改;Token 仍是本机 JSONL 统计,不代表 OpenAI 账单或账号配额。