fix(acp): use formatCompactTokenCount for subagent activity card toke… - #1165
Open
rohanshrma222 wants to merge 2 commits into
Open
fix(acp): use formatCompactTokenCount for subagent activity card toke…#1165rohanshrma222 wants to merge 2 commits into
rohanshrma222 wants to merge 2 commits into
Conversation
rohanshrma222
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
September 3, 2026 06:42
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.
Description
Fixes the subagent activity card in the ACP (VS Code extension) integration showing imprecise token counts. It previously computed Math.floor(tokenCount / 1000) and appended k, so 1–999 tokens displayed as 0k and 1500–1999 all displayed as 1k. Now it reuses the existing formatCompactTokenCount formatter from source/usage/format.ts (already used for the per-response usage indicator), so e.g. 1900 tokens correctly shows 1.9k tokens.
Closes #1133.
Type of Change
Changeset
Testing
Automated Tests
No new test added — this is a one-line formatting fix reusing an already-tested formatter (formatCompactTokenCount, covered by existing source/usage/*.spec.ts). Verified the fix's output directly with a throwaway script against the token counts from the issue (500 → 500, 1900 → 1.9k, 12345 → 12.3k, vs. the old 0k/1k/12k).
Manual Testing
This path only renders inside the ACP/VS Code extension subagent activity card and isn't reachable through the plain CLI providers above; verified via direct formatter comparison instead of a live ACP session (see Testing notes).
Checklist