Skip to content

Releases: Uddoo/TrafficMonitor-Codex-Plugin

v0.1.12 - 修复 Codex 程序发现与额度回退诊断

Choose a tag to compare

@github-actions github-actions released this 20 Sep 02:23

修复 Windows 上 TrafficMonitor 找不到 Codex 程序、额度长期停留在历史百分比的问题。

修复内容

  • 自动发现 Codex 桌面应用中的可执行文件,支持 PATH 缺失及桌面应用更新后的版本目录变化;额度和账号 Token 查询共用发现逻辑。
  • 状态 JSON、诊断日志和悬停提示明确显示实时查询失败原因;使用本地额度记录时,同时显示原始记录时间。
  • 区分程序缺失、配置路径失效、启动失败、超时、接口错误和无有效数据;诊断不保存原始接口错误、凭证或响应正文。
  • 补齐 app-server 初始化通知,调整读线程与子进程的退出顺序。

验证

  • 62 项 Python 测试通过,其中新增 14 项程序发现、回退、错误脱敏和真实 stdio 回归测试。
  • x64 Release 构建与 C++ JSON/提示框 smoke 测试通过。
  • 本机已验证不含 Codex 的 PATH 下,桌面应用发现及实时额度查询可以成功;实际运行中也确认了接口超时后的诊断提示。

已知限制

实时额度和账号 Token 请求仍使用原有的 6 秒超时。接口响应较慢时仍可能回退到本地数据;本版本会明确提示原因和额度记录时间,不保证消除网络或服务端延迟。

安装

退出 TrafficMonitor,将附件中的 CodexUsage.dll 和 scripts 目录解压到 TrafficMonitor 的 plugins 目录后重新启动。保留 plugins/CodexUsage 下的现有配置和运行数据。发布 DLL 未签名。

Full changelog: v0.1.11...v0.1.12

v0.1.11

Choose a tag to compare

@github-actions github-actions released this 24 Aug 07:18

Full Changelog: v0.1.10...v0.1.11

v0.1.10 - Fix quota window detection

Choose a tag to compare

@github-actions github-actions released this 13 Jul 01:28

中文

此版本修复了 Codex 临时移除 5 小时使用限制后,周限额被错误显示为 5 小时限额、周限额本身显示为 -- 的问题。

修复内容

  • 根据接口返回的 windowDurationMins 识别额度窗口:300 分钟对应 5 小时额度,10080 分钟对应周额度。
  • 当接口仅返回一个 7 天 primary 窗口时,将其正确显示为周限额,并将当前不存在的 5 小时额度显示为 --。
  • 当 5 小时限额恢复且接口再次返回双窗口时,可以自动恢复 5 小时和周限额的正确映射。
  • 对没有窗口时长字段的旧 session 和日志数据继续保留 primary / secondary 位置兼容。

验证

  • 43 项 Python 测试全部通过。
  • GitHub Actions Windows Release 构建、C++ JSON 解析 smoke、打包和资产上传全部通过。
  • 已使用真实 account/rateLimits/read 返回验证单周窗口场景。

English

This release fixes weekly Codex quota data being mislabeled as the 5-hour quota after the 5-hour usage limit was temporarily removed.

Fixed

  • Classify quota windows from windowDurationMins: 300 minutes for the 5-hour quota and 10080 minutes for the weekly quota.
  • Correctly map a lone 7-day primary window to the weekly quota while showing the unavailable 5-hour quota as --.
  • Automatically restore the traditional 5-hour and weekly mapping when the dual-window response returns.
  • Preserve positional compatibility for older session and log records without window-duration metadata.

Validation

  • All 43 Python tests passed.
  • GitHub Actions passed the Windows Release build, C++ JSON parser smoke test, packaging, and asset upload.
  • Verified against a live single-weekly-window account/rateLimits/read response.

Installation

Download CodexUsage-TrafficMonitor-x64.zip, close TrafficMonitor, and replace CodexUsage.dll plus the bundled scripts directory under the TrafficMonitor plugins directory. Keep the existing plugins\CodexUsage runtime configuration directory unchanged, then restart TrafficMonitor.

v0.1.9

Choose a tag to compare

@github-actions github-actions released this 04 Jul 02:59

Changelog

v0.1.9 - 2026-07-04

  • Switched the default Today Token source to Codex app-server account/usage/read, using account-level daily buckets.
  • Added a plugin setting to switch Today Token back to the local rollout-based Input / Output / Cached breakdown.
  • Kept quota display as remaining percentage while reading app-server account/rateLimits/read used percentages.
  • Hardened account daily token bucket fallback so future buckets are not shown as today.
  • Updated status JSON documentation and tests for the new token source fields.

v0.1.8

Choose a tag to compare

@github-actions github-actions released this 04 Jul 02:25

更新内容

  • 额度来源改为优先调用 codex app-server --listen stdio:// 的 account/rateLimits/read,读取 rateLimitsByLimitId["codex"] 主额度,避免误用模型/子额度导致显示不准。
  • 保持 TrafficMonitor 中显示“剩余额度百分比”:采集器会把 app-server 返回的 primary.usedPercent / secondary.usedPercent 转换为 100 - usedPercent。
  • 保留本地 session JSONL 和 legacy log fallback;当 Codex 内部 app-server 协议变化或不可用时,仍会回退到旧采集路径。
  • 新增 CODEX_TRAFFICMONITOR_CODEX_BIN 和 CODEX_TRAFFICMONITOR_APP_SERVER=disabled 配置,用于指定 Codex 可执行文件或关闭 app-server 读取。
  • 修复 app-server 初始化失败时可能遗留 codex app-server 进程的问题。
  • 插件版本更新为 0.1.8。

验证

  • 本地:python -m unittest discover -s tests -v
  • 本地:.\tools\build.ps1 -Platform x64 -Configuration Release -SkipSign
  • GitHub Actions:Release workflow 已通过,包含 Python tests、x64 Release DLL 构建、C++ smoke、打包和 GitHub Release 发布。

下载

  • CodexUsage-TrafficMonitor-x64.zip

Full Changelog: v0.1.7...v0.1.8

v0.1.7

Choose a tag to compare

@github-actions github-actions released this 03 Jul 14:46

更新内容

  • 修复 Codex 额度显示可能被模型子额度覆盖的问题。
  • 采集器现在会忽略 codex_bengalfox 等非主 codex 的 rate_limits 事件,避免任务栏误显示 5h 100% / 周 95% 这类错误余额。
  • 插件版本更新到 0.1.7。

验证

  • python -m unittest discover -s tests -v
  • .\tools\build.ps1 -Platform x64 -Configuration Release -SkipSign

本机未安装可直接调用的 cmake/ctest;GitHub Actions Release workflow 已成功执行完整 CMake smoke、打包和发布。

v0.1.6

Choose a tag to compare

@github-actions github-actions released this 01 Jul 06:12

Full Changelog: v0.1.5...v0.1.6

v0.1.5

Choose a tag to compare

@github-actions github-actions released this 01 Jul 03:10

更新日志

新增

  • 新增插件界面英文显示,覆盖显示项目名称、任务栏标签、tooltip、插件命令、选项窗口、通知和错误提示。
  • 插件选项新增语言设置:自动、中文、English。自动模式会跟随 TrafficMonitor 当前语言,非中文语言默认显示英文。
  • 采集链路新增语言参数传递,DLL、PowerShell 包装脚本和 Python 采集器会统一输出同一种语言。

改进

  • 状态 JSON 中面向用户的 message、reset_display、reset_credits_tooltip 支持中英文输出。
  • 英文模式下显示项目改为 Codex 5-hour quota / Codex weekly quota,任务栏标签为 5h / wk。
  • 选项窗口布局为英文按钮和路径标签预留了更宽空间,减少文本截断。
  • 数据格式文档补充了本地化显示字段说明。

兼容性

  • 默认语言仍为中文;未修改用户设置时保持原有中文显示。
  • codex_usage_plugin.ini 新增 language=auto|zh-CN|en-US,原有 refresh_interval_seconds 设置保持兼容。
  • reset credits、额度百分比、Token 明细和隐私清洗行为保持兼容。

版本

  • 插件版本更新到 0.1.5。

验证

  • python -m unittest discover -s tests -v
  • ./tools/build.ps1 -Platform x64 -Configuration Release -SkipSign
  • PowerShell 英文采集烟测已确认生成英文状态 JSON。
  • GitHub Actions Release workflow 已通过,并上传 CodexUsage-TrafficMonitor-x64.zip。

完整变更: v0.1.4...v0.1.5

v0.1.4

Choose a tag to compare

@github-actions github-actions released this 01 Jul 02:28

更新日志

新增

  • 在 TrafficMonitor tooltip 中新增 Token 明细 区块,显示今日 Input、Output、Cached 三项数据。
  • Token 明细优先从 state_5.sqlite 定位 rollout JSONL,并读取 token_count.info.total_token_usage 按本机当天增量统计。
  • 状态 JSON 新增 today_input_tokens*、today_output_tokens*、today_cached_input_tokens* 字段;today_tokens* 保留为兼容字段,并在 rollout 口径下使用 input + output。
  • 插件选项窗口新增状态、日志、采集脚本路径的就近打开与复制操作,并改为 DPI 感知布局。

兼容与失败处理

  • rollout token 统计不可用时,采集脚本会回退到旧的日志或线程汇总字段。
  • 现有额度、重置时间与 reset credits tooltip 行为保持兼容。

版本

  • 插件版本更新到 0.1.4。

验证

  • python -m unittest discover -s tests -v
  • ./tools/build.ps1 -Platform x64 -Configuration Release -SkipSign
  • GitHub Actions Release workflow 已通过,并上传 CodexUsage-TrafficMonitor-x64.zip。

v0.1.3

Choose a tag to compare

@github-actions github-actions released this 01 Jul 01:40

更新日志

新增

  • 在 TrafficMonitor tooltip 中展示 Codex 额度重置卡信息:可用数量、每张卡的状态、标题、获取时间和过期时间。
  • 采集脚本会读取本机 Codex auth.json 中的 tokens.access_token,请求 ChatGPT reset credits 接口,并把 UTC 时间转换为当前电脑时区显示。

隐私与失败处理

  • 状态 JSON 和 tooltip 只写入 available_count、status、title、granted_at、expires_at,不会写入 access token、refresh token、cookie 或完整唯一 ID。
  • 如果本机缺少凭证、接口返回 401 或请求失败,则不展示重置卡区域;401 会记录为凭证失效或未携带 Authorization header。
  • 对既有 rate-limit 来源字段中的完整 UUID 也做了短化,避免状态文件暴露完整唯一 ID。

其他

  • 插件版本更新到 0.1.3。
  • 更新 README 和数据格式文档。
  • 增加 reset credits 采集、脱敏、401 处理、tooltip 条件展示测试。

验证

  • python -m unittest discover -s tests
  • .\tools\build.ps1 -Platform x64 -Configuration Release -SkipSign
  • GitHub Actions Release workflow 已通过,并上传 CodexUsage-TrafficMonitor-x64.zip。