Skip to content

[codex] Update Codex Token Usage to 0.1.3#10

Open
kokotao wants to merge 4 commits into
BigPizzaV3:mainfrom
kokotao:albertLuo/update-codex-token-usage-0.1.1
Open

[codex] Update Codex Token Usage to 0.1.3#10
kokotao wants to merge 4 commits into
BigPizzaV3:mainfrom
kokotao:albertLuo/update-codex-token-usage-0.1.1

Conversation

@kokotao
Copy link
Copy Markdown
Contributor

@kokotao kokotao commented Jun 1, 2026

Summary

Updates the Codex Token Usage market script to version 0.1.3.

This release fixes session-scoped rendering and restores the historical per-call aggregation behavior. The important correction in 0.1.3 is that Codex token_count.total_token_usage is treated as cumulative session/turn context information, not as a single model call. Per-reply input/output totals and 调用 N 次 are again derived from repeated last_token_usage / model usage updates entering the turn call list.

Details

  • Scope token usage metrics by active conversation/thread id.
  • Clear stale badges when switching to a conversation with no recorded metric.
  • Restore cached metrics only for the active conversation.
  • Show the running badge only after a Codex API request starts, not while typing or pressing Enter.
  • Restore historical call aggregation by using last_token_usage as the per-call token usage source.
  • Avoid treating cumulative total_token_usage as a single model call, which made call count stick at 1 and token totals look wrong.
  • Always show completed call count, including 调用 1 次.
  • Bumps codex-token-usage metadata to 0.1.3 and refreshes SHA-256.

Validation

  • Source script tests passed in codex-token-usage-script: npm test -> 19/19 passing.
  • Source script metadata validation passed: npm run check:index.
  • Local installed Codex++ user script copies were synced and byte-compared against the source script.
  • Market index.json SHA was validated against scripts/codex-token-usage.js.
  • Market script was byte-compared against the verified source script.

@kokotao kokotao changed the title [codex] Update Codex Token Usage to 0.1.1 [codex] Update Codex Token Usage to 0.1.2 Jun 1, 2026
@kokotao kokotao changed the title [codex] Update Codex Token Usage to 0.1.2 [codex] Update Codex Token Usage to 0.1.3 Jun 1, 2026
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