Skip to content

feat: add Codex usage telemetry#12

Open
catwithtudou wants to merge 1 commit into
MagicCube:mainfrom
catwithtudou:feat/codex-usage-telemetry
Open

feat: add Codex usage telemetry#12
catwithtudou wants to merge 1 commit into
MagicCube:mainfrom
catwithtudou:feat/codex-usage-telemetry

Conversation

@catwithtudou

Copy link
Copy Markdown

Summary

  • Add a Codex usage endpoint that reads local token_count events from Codex session JSONL files
  • Add a current usage endpoint so the Usage page renders the active agent provider without querying Claude in Codex mode
  • Update the Usage page to show Codex rate-limit windows, reset times, token usage, and unavailable states

Notes

Codex usage is best-effort local telemetry from session logs, not official billing usage. If CODEX_HOME or ~/.codex does not contain token_count/rate_limits events, the endpoint returns an unavailable state instead of failing.

Test Plan

  • FEISHU_APP_ID=test FEISHU_APP_SECRET=test bun test
  • FEISHU_APP_ID=test FEISHU_APP_SECRET=test bun run check
  • bun run build:js
  • bun run build:bin
  • curl http://localhost:1985/api/usage/current against a minimal local usage route server

@catwithtudou

Copy link
Copy Markdown
Author

Screenshot of the Codex usage telemetry UI:

clipboard

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