Skip to content

feat(tui): reland token activity command#27925

Merged
fcoury-oai merged 1 commit into
mainfrom
codex/reland-token-activity-command
Jun 13, 2026
Merged

feat(tui): reland token activity command#27925
fcoury-oai merged 1 commit into
mainfrom
codex/reland-token-activity-command

Conversation

@fcoury-oai

Copy link
Copy Markdown
Contributor

Why

#25345 was approved, green, and squash-merged into its stacked base branch, fcoury/tokenmaxxing-api. Four minutes later, that base branch was force-pushed back to an API-only rebased head while preparing #25344 for main. As a result, the squash commit from #25345 was orphaned and the TUI command never reached main or a release.

This PR relands the orphaned TUI change from 411410b8 on current main.

What changed

  • Add /usage, /usage daily, /usage weekly, and /usage cumulative for account token activity.
  • Fetch account usage asynchronously through the existing account/usage/read app-server RPC.
  • Render daily, weekly, and cumulative activity with theme-aware terminal palettes and bounded transient cards.
  • Preserve transcript ordering while assistant streams, history consolidations, active cells, and hooks complete.
  • Hide /usage from completion when backend auth is unavailable while keeping typed-command guidance.
  • Carry current-main behavior forward for cwd-aware Markdown parsing, Windows Terminal color detection, and personal access token auth.
  • Clear pending usage cards on thread rollback and delay completed cards until live hook output is committed.
  • Add focused regression and snapshot coverage for loading, auth errors, invalid views, rollback, hook ordering, layout, and charts.

Prior review

The original implementation was approved by Eric Traut in #25345 after testing multiple themes and light/dark terminals. This PR preserves that reviewed implementation while adapting it to current main and adding regression coverage for newer rollback and hook lifecycle behavior.

Validation

  • just test -p codex-tui token_activity palette renderable usage_command — 37 passed.
  • Focused rollback, hook-ordering, and error snapshot tests — 4 passed.
  • just fix -p codex-tui — passed.
  • UV_CACHE_DIR=/private/tmp/codex-uv-cache just fmt — passed.
  • cargo insta pending-snapshots — no pending snapshots.
  • just test -p codex-tui — 2,870 passed; two unrelated guardian feature-flag tests failed because their expected OverrideTurnContext event was absent:
    • update_feature_flags_disabling_guardian_clears_manual_review_policy_without_history
    • update_feature_flags_disabling_guardian_clears_review_policy_and_restores_default
  • just argument-comment-lint could not complete because the local Bazel LLVM compiler-rt repository is missing include/sanitizer/*.h. The touched Rust diff was manually inspected and no missing opaque-literal argument comments were found.

@fcoury-oai fcoury-oai marked this pull request as ready for review June 12, 2026 18:21

@etraut-openai etraut-openai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that the branch is effectively unchanged from what I previously reviewed.

@fcoury-oai fcoury-oai force-pushed the codex/reland-token-activity-command branch from 6654cae to 40447b6 Compare June 13, 2026 00:08
@fcoury-oai fcoury-oai merged commit c884536 into main Jun 13, 2026
31 checks passed
@fcoury-oai fcoury-oai deleted the codex/reland-token-activity-command branch June 13, 2026 00:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants