Repository navigation
revert: drop estimated kiro-cli tokens from the usage tab (#16123) - #22497
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. [UX-REVIEWED] f45d248 Description read[DESCRIPTION-READ] 641a98e8bf7466935567cce238fc0eb6430125db7603066a662ff70932898b27 That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ human override accepted@CrysisDeu overrode this lane for |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] f45d248 Description read[DESCRIPTION-READ] f8c0a08763bc9490f7bb3fd508b172872f15c46b31a937ec86f00329760ae6d2 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Human judgment recorded@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
This reverts commit 7f60e451f6d. Removes the Estimated Tokens card, the Est. tokens Daily History column and the backend estimator that fed them. Credits stay as they were. The estimator moved from handlers/usage.py into handlers/usage_sessions.py after the original PR (#20835), so that part is reverted by hand there; usage.py drops only the facade re-exports. The docs keep the later credit run-out paragraph.
6467a21 to
f45d248
Compare
Human judgment recorded@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Problem / Motivation
Goal: The Usage tab stops showing estimated Kiro CLI token figures; credits stay as they are.
#16123 added an "Estimated Tokens" card and an "Est. tokens" Daily History column to
/settings/overview?view=usage. kiro-cli records no token counts, so every figure is a guess built from context-window percentages, request counts and reply length / 4. The owner does not want a guessed number on the Usage tab next to the credits, which are the real billed figure.Why it matters
A guessed token count shaped like a measurement reads as one. Kiro bills in credits, and the tab already shows credits per day and per period, so the estimate adds a second, less reliable number for the same spend. Keeping it also keeps ~270 lines of session-document parsing running on every Usage refresh.
Not a goal
What changed (motivation → approach → change)
Owner request to remove the estimate → revert #16123 (
7f60e451f6) → the card, the column and the backend estimator are gone.git revertdid not apply cleanly because #20835 later moved the estimator fromhandlers/usage.pyintohandlers/usage_sessions.py. So:handlers/usage_sessions.py: removed_estimate_cli_tokens,_sum_estimate,_turn_window,_est_count,_est_percentand their constants;_parse_sessionsgoes back toiterdir()and no longer emitsestimated_tokensor per-dayest_tokens;_empty_session_summarydrops the zero block.handlers/usage.py: only the facade re-exports of those names are dropped. Everything added there after feat(usage): estimate Kiro CLI token use on the Usage tab #16123 is kept.handlers/usage.pyalso stops servingFileTooLargeErrorandsafe_read_file_bytes_nolink(only the removed estimator imported them), sotest/campaign_facade_inventories/kiro_crew.dashboard.handlers.usage.jsondrops them too. No caller reads them through the facade onorigin/main.UsageTab.tsxdropsEstimatedTokensCardand the column; the phone line keeps the credits-only form.providers/adapters/acp.ts/types.ts/index.tsdrop the mapping and theTokenEstimatetype.en.context.json.learn-cron-dashboard.md; the later Kiro Account run-out paragraph that sits after it is kept. The feature-map Usage row goes back to its earlier text.This removes a user-facing capability. No RFC records it; it is the maintainer's own call, so the First Principles lane may need a maintainer
/ai-review override.Backwards compatibility
Compatible: the removed payload keys were only ever read by the frontend code this PR also removes; an older dashboard against this gateway already treats a missing
estimated_tokensblock as "no estimate" and shows nothing.Reader: website/src/providers/adapters/acp.ts:estimatedTokens -- chat|crew page -- removed in this PR
Reader: website/src/pages/overview/UsageTab.tsx:EstimatedTokensCard -- chat|crew page -- removed in this PR
Reader: website/src/api/creditForecast.ts:forecastCreditRunOut -- chat -- reads
daily_history[].creditsonly, untouchedReader: src/kiro_crew/dashboard/handlers/usage.py facade re-exports -- release -- removed in this PR; no other importer on origin/main
Reader: test/test_usage.py, test/test_usage_daily_credits.py -- release --
estimated_tokens/est_tokensexpectations removedTests
test/test_usage_estimated_tokens.py,website/src/test/UsageTab.estimatedTokens.test.tsxandwebsite/src/test/AcpAdapter.usageEstimatedTokens.test.ts(they pinned the removed feature).test/test_usage.pyandtest/test_usage_daily_credits.pygo back to the payload shape withoutestimated_tokens/est_tokens.npm run typecheck, eslint on the touched files,npm run i18n:check,check_comment_history.py,check_brand_name.py. CI runs the tests.Manual verification
Done on two isolated pods:
mainat b174436 (before) and this branch at 6467a21 (after). Both pods were given the same 15 real kiro-cli session documents, so both read the same data. On/settings/overview?view=usage, before shows the Estimated Tokens card and the Est. tokens column; after shows neither. Billing, Spend over time, Session activity and the Daily History credits columns render the same, with no gap where the card was.Screenshots / video
Real builds on isolated pods, same 15 kiro-cli sessions in both.
Desktop, top of the Usage tab: before has the Estimated Tokens card between Billing and Spend over time; after goes straight from Billing to Spend over time.
Desktop, Daily History: the Est. tokens column is gone; the credits columns stay.
The before pod also shows a 2026-10-20 row (0.04 credits). That pod ran one background turn today and the after pod did not; it is pod data, not this change.
Phone (390px): page top and Daily History
On the phone the second line under each day goes from "Credits used · % · Est. tokens" back to "Credits used · %".
Related Issues
Reverts #16123.
Pattern harvest
Not generalizable: this reverts a feature by owner decision, not a defect.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.