You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f6e6a01
Browse filesBrowse the repository at this point in the historyBrowse files
fix(script): replay tokens exactly and compact the way the product does
Review of 2d87d50198 (token-usage / token-report):
- "actual (no lever)" was not actual: the replay folded cache writes into
cached reads (priced at the read price) and dropped reasoning, which
totals() charges. It now tracks cache writes and reasoning separately;
with no lever it reproduces input, cached read, cache write, output and
reasoning exactly, tested with nonzero writes and reasoning, and the
report prices projections with priced() like the actual requests.
- The compaction replay diverged from the product. It now calls the
product's overThreshold before each request on the last finished
request's tokens (prompt + output, as count() does), skips the check
after a summary, and resets the re-compaction floor after every
summary, real or simulated, as floorAfterCompaction does.
- The two settings are modelled separately: --compact-at is
compaction.threshold (every turn); --autonomous-compact-at is
experimental.accuracy.autonomous_compact_at (turns sent with
autonomous: true, read from the parent user message). On the Muse
data the autonomous default alone changes nothing: their turns are
not flagged autonomous.
- The database reading moved into readSteps() with a test against an
in-memory SQLite database (tool rows assigned to their step, UTF-8
byte counts, cut flags from outputPath/archive, summary and autonomous
flags). Also tested: the histogram, and an exact compaction count for
the guard (7) instead of a range.
- The report prints "-" instead of InfinityB for an empty measure.
Ref LDE-40, anomalyco#47
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GHX6CpBR14wnFxJLDahwTr
0 commit comments