github seakee/CPA-Manager-Plus v1.12.2

12 hours ago

CPA Manager Plus v1.12.2

34 commits · 117 files changed · +8870 / -485

English ->

Overview

v1.12.2 聚焦配额归属、重置时间和大型历史数据库的升级可运维性:Codex Spark 与主配额使用量不再混算,配额重置时间在浏览器本地时区正确显示,Manager Server 会把延后的数据库维护状态展示给用户,并让账户历史查询在索引可用时按凭证限制候选行。此版本保留 listener-first 启动边界,不改写 authoritative usage_events

Highlights

Features

  • Codex 配额按主产品、Spark 和其他 feature scope 分开归属,Spark 不再继承账户级或主配额使用量;无法完整解析的 scope 会 fail closed,不显示不可靠的 usage 或 forecast。
  • GET /status 新增脱敏的 databaseMaintenance 状态,并提供 ?scope=database-maintenance 的 metadata-bounded 读取,报告维护要求、查询性能风险、deferred index 数量、offline job 数量和稳定 reason code。
  • Manager Server 面板、System Info 和 Request Monitoring 会显示数据库维护 Warning、待处理数量和长时间范围查询提示,并提供 Docker Compose 与原生 cleanup-derived 操作指引。

Fixes

  • Codex quota evidence、usage attribution、forecast 和 summary 现在使用相同的 resolved/billing scope,Spark 不再污染主配额统计;历史错误 scoped snapshot 会在有可靠证据时被抑制或停用。
  • Codex credential health、Accounts、monitoring 和 Server Codex inspection 会按浏览器本地时区显示绝对 reset time,同时保留旧版 reset label 和 reset accuracy 兼容路径。
  • xAI 配额展示保留产品级 reset 语义,避免统一重置时间格式覆盖 provider-specific 信息。
  • Accounts 的 account-history 最近请求在复合索引可用时按凭证执行有界 top-N 读取,保留 NULL、空 auth_index、snapshot 和 legacy source 的兼容语义;索引不完整时继续使用原有安全回退。
  • deferred-index 决策会持久化到有界 metadata ledger,并与 SQLite schema、derived cleanup 和 quota migration metadata 重新计算;即使派生表暂时为空,也不会错误隐藏仍缺失的索引。
  • databaseMaintenance 只暴露稳定 reason code、计数和命令提示,不暴露数据库绝对路径、原始 SQL、索引名称或底层迁移错误;既有 /status 字段保持兼容。

Performance

  • Request Monitoring 的 100k projection 回归覆盖索引可用和缺失时的 query plan,避免历史数据查询静默退化为昂贵的临时排序。
  • account-history 查询在索引路径上先限制每个凭证的候选行,再合并全局 top-N,避免对单个凭证的全部历史执行窗口排序或 full scan。
  • 启动策略保持 listener-first:不会在监听前对非空大表无条件创建索引,Web UI 也不会在线运行离线清理。

Docs

  • 中英文 Manager Server、Docker 和更新文档补充 maintenance 状态、停止服务要求、完整 cleanup 命令和 usage_events 数据安全边界。
  • 中英文 README 和文档首页更新为当前面板截图。

Upgrade Notes

  • 升级前请一起备份 SQLite、WAL、SHM 和 data.key。Manager Server 会先监听 HTTP,再继续执行有界后台维护。
  • 如果 UI Warning 或 /status.databaseMaintenance.requiredtrue,请先停止 Manager Server。Docker Compose 用户执行:
docker compose stop cpa-manager-plus

docker compose run --rm --no-deps \
  cpa-manager-plus \
  cleanup-derived --db-path /data/usage.sqlite

docker compose start cpa-manager-plus
  • 原生安装使用 cpa-manager-plus cleanup-derived;非默认数据库可追加 --db-path /path/to/usage.sqlite
  • cleanup-derived 需要独占 SQLite 进程锁,不能从 Web UI 在线执行。完成离线维护并重启后,状态和 UI Warning 会根据真实 SQLite metadata 自动恢复正常。
  • usage_events 仍是 authoritative source;本版本不会删除、重建或改写它,也没有破坏性数据迁移。

Acknowledgements

  • @HuiCheng - 改进大历史数据库中的 Accounts 最近请求读取,避免为展示最新请求扫描每个凭证的全部历史。

Full Changelog: v1.12.1...v1.12.2

Don't miss a new CPA-Manager-Plus release

NewReleases is sending notifications on new releases.