Skip to content

feat: add codex inspector - #16

Merged
mcoder2014 merged 8 commits into
masterfrom
feat/cq/codex_inspector
Jul 4, 2026
Merged

mcoder2014 merged 8 commits into
masterfrom
feat/cq/codex_inspector

Conversation

@mcoder2014

@mcoder2014 mcoder2014 commented Jul 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • 新增实验性 codex_inspector CLI,在 127.0.0.1 启动本地 Web UI 查看 Codex session、活跃度、token 消耗、memory 和 diagnostics。
  • 增加容错 JSONL parser、历史 session SQLite summary cache、raw JSONL 展开、敏感字段脱敏和只读数据源探测。
  • 完善 SQLite cache 生命周期:disabled / missing / healthy / corrupt / rebuilding / unavailable;cache 不可用时降级实时解析 JSONL。
  • 新增 cache API 和 Diagnostics 操作:Create cache、Fill missing cache、Backup and rebuild cache;corrupt cache 会备份为 .corrupt.<timestamp>.bak 后重建。
  • 新增 -cache-workers,默认 2,0 禁用启动后的自动补齐;后台补齐只处理今天以前的 rollout。
  • 新增 cli/codex_inspector/install.sh 快速安装脚本;默认安装到 $HOME/.local/bin,兼容 macOS / Linux,只有显式 --system 或 --allow-sudo 时才尝试 sudo。
  • 补充 README、安装文档、CLI 文档、隐私边界、故障排查、Mermaid 架构图和脱敏截图。

Verification

  • bash -n cli/codex_inspector/install.sh
  • ./cli/codex_inspector/install.sh --help
  • GOMODCACHE=/tmp/codex_inspector_mod_cache GOCACHE=/tmp/codex_inspector_go_cache ./cli/codex_inspector/install.sh --prefix /tmp/codex-inspector-install-validation
  • /tmp/codex-inspector-install-validation/bin/codex_inspector -h
  • GOMODCACHE=/tmp/codex_inspector_mod_cache GOCACHE=/tmp/codex_inspector_go_cache go test ./cli/codex_inspector
  • GOMODCACHE=/tmp/codex_inspector_mod_cache GOCACHE=/tmp/codex_inspector_go_cache go test ./...
  • GOMODCACHE=/tmp/codex_inspector_mod_cache GOCACHE=/tmp/codex_inspector_go_cache go build -o output/codex_inspector ./cli/codex_inspector/...
  • GOMODCACHE=/tmp/codex_inspector_mod_cache GOCACHE=/tmp/codex_inspector_go_cache ./build.sh
  • node --check cli/codex_inspector/static/app.js
  • Chrome real UI QA: Overview / Sessions / Memory / Diagnostics at 390x844, 768x1024, 1440x900; no app console errors, no page-level overflow.
  • Chrome cache QA with sanitized fixture on 127.0.0.1:8794: missing -> Create cache -> healthy, today rollout skipped, corrupt -> confirm Backup and rebuild cache -> healthy, backup file verified.
  • UI review agent: passed after fixes.

Notes

  • codex_inspector is documented as an experimental tool and is not added to the root install.sh stable default list.
  • The app does not write to ~/.codex; historical summaries are cached in the tool-owned user cache directory or -cache-path.
  • Cache stores sanitized SessionSummary, token aggregates, file size, and file mtime only; it does not store raw JSONL or full conversation content.
  • Mermaid render verification was not completed because local Mermaid CLI tooling was unavailable under the current policy.

@mcoder2014
mcoder2014 marked this pull request as ready for review July 4, 2026 08:05
@mcoder2014
mcoder2014 merged commit a855442 into master Jul 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant