fix(report): route displayed output through billableOutputTokens - #1116
Merged
iamtoruk merged 4 commits intoAug 23, 2026
Conversation
Cost already used the helper. Report, sessions, overview and optimize did not, so exclusive providers dropped reasoning and optimize double-counted it for claude/codex/copilot. Daily cache v28 re-derives. Closes getagentseal#1115
Compare, export, report JSON, overview Top-model/By-tool/day, and menubar localModelSavings still summed raw output. Session totals stay defined on aggregate-only and stub calls. Upgrade verifier expects daily-cache.v28.json.
Per-call billable output was written under raw call.model while parser buckets use getShortModelName. Display aliases split into a zero-output named row and a phantom raw-id row. Aggregate-only sessions fall back to each existing bucket.
Parser sessions key modelBreakdown by getShortModelName. Leftover raw-id buckets (overview fixtures, cached summaries) were minting a second $0 / 0-call short-name row that findUnpricedModels flagged as Unpriced and failed CI on getagentseal#1116.
Member
|
Reviewed (DeepSeek draft + maintainer verification of every finding against the diff). No verified defects. Claims checked: all display paths route through Looks merge-ready from the review side; will run the standard parity pass before merge. |
avs-io
added a commit
to avs-io/codeburn
that referenced
this pull request
Aug 23, 2026
…ntseal#1122 — daily cache v29 getagentseal#1115 took v28 on main. OrcaRouter pricing takes the next number. Keep-both CHANGELOG. MIN_SUPPORTED stays 28.
avs-io
added a commit
to avs-io/codeburn
that referenced
this pull request
Aug 23, 2026
…ntseal#1122 Keep-both CHANGELOG: getagentseal#916 ledger + getagentseal#899 probeRoots. No cache bump.
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.
Problem
report,sessions, overview andoptimizedisplay output tokens that do not match the cost path after #1078.Measured on Grok (184 sessions): report was short by exactly
totalReasoningTokens(2,631,342). Cost was already correct.Root cause
billableOutputTokens(provider, output, reasoning)is the source of truth: exclusive providers add reasoning;{claude, codex, copilot}already include it in output.Cost / models / audit use the helper. Day aggregation, period data, sessions JSON, overview and
optimize.tscontext-bloat still read rawoutputTokensor blindly sumoutput + reasoning.Change
billableOutputTokens.sessionBillableOutputTokens(sum per call; fallback uses inferred provider).reportmatches the live parse.User impact
Grok (and other exclusive providers) report output goes up by reasoning. Optimize no longer inflates generated-token denominators for Codex/Copilot/Claude.
Preservation
Cost, models report and audit were already on the helper. No rate changes. No provider parser changes.
Testing
HERMES_HOME=/tmp/cb-cleanhome npx vitest run tests/billable-output-1115.test.ts tests/day-aggregator.test.ts tests/sessions-report.test.ts tests/daily-cache.test.ts— 51 passed.Closes #1115
Thanks @saulcanina.