[codex] add token profile history diagnostics#1417
Draft
peyton-alt wants to merge 3 commits into
Draft
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 93eb40f. Configure here.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new top-level entire tokens command group with a profile subcommand that scans committed checkpoint metadata to produce historical token-usage diagnostics (aggregates, repeated signals, recommendations, limitations) with optional --json output.
Changes:
- Introduces
entire tokens profilewith default scope of the latest 50 committed checkpoints and--limit/--allscope controls. - Implements reporting: aggregated token usage, repeated signal detection, recommendations, limitations, and JSON/text renderers.
- Adds unit tests covering text output, JSON output, limit scoping, and empty history behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/entire/cli/tokens_profile.go | New tokens command group and profile implementation, including report building + renderers. |
| cmd/entire/cli/tokens_profile_test.go | New tests for entire tokens profile output modes and scoping behavior. |
| cmd/entire/cli/root.go | Registers the new tokens noun-group command in the root CLI. |
5e86ec3 to
f7bd582
Compare
93eb40f to
5315c62
Compare
f7bd582 to
c26b87f
Compare
Entire-Checkpoint: cdebea3708fd
Entire-Checkpoint: e945a42148c6
Entire-Checkpoint: c04a3bb165a4
5315c62 to
50d2709
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
entire tokens profilefor historical checkpoint token diagnostics--limitand--allfor scope controlVerification
GOCACHE=/private/tmp/entire-go-cache go test ./cmd/entire/cli -run 'TestTokensProfileCmd' -count=1GOCACHE=/private/tmp/entire-go-cache go test ./cmd/entire/cli -run 'Test.*Tokens|Test.*Token' -count=1GOCACHE=/private/tmp/entire-go-cache go test ./cmd/entire/cli -count=1mise run lintmise run checkentire tokens profile --limit 5and defaultentire tokens profileboth completed successfully over 4,306 available checkpointsNote
Low Risk
Read-only local git checkpoint metadata analysis with no auth or data writes; main risk is slow runs when using
--allon very large histories.Overview
Adds a top-level
entire tokenscommand group withprofile, which scans committed checkpoint metadata only (no transcripts) to aggregate historical token usage and surface repeated patterns.By default it analyzes the latest 50 checkpoints;
--limitand--allcontrol scope. Output includes aggregated totals, repeated signals (cache/context replay hotspots, high API call counts, subagent-heavy checkpoints, missing token data), actionable recommendations, explicit limitations, and optional--json. Token rollup reuses the same formatting/aggregation helpers as existing session/checkpoint token commands.Tests cover text and JSON output, limit scoping, and empty checkpoint history.
Reviewed by Cursor Bugbot for commit 93eb40f. Configure here.