Repository navigation
Conversation
A slice with tokens but no calls, cost or savings (a Hermes or Copilot session total) read as a placeholder, so every adoption or re-derive merge replaced it while adding its tokens to the day and model rows again. Each version bump multiplied them by the number of older cache files holding the day. Count tokens as slice data, and cap day and model-row tokens at the slices' sum on load for days whose slices all carry token figures. A newer token-only slice now wins over an older one with calls, as the newer-wins rule intends, instead of the two being added.
This branch has not been deployed
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.
Token totals on some days grow with every cache version bump.
A slice with tokens but no calls, cost or savings (a Hermes or Copilot session total) was treated as a placeholder. On every adoption or re-derive merge it was replaced while its tokens were added to the day and model rows again, so each bump multiplied them by the number of older cache files holding that day.
hasSliceDatacounts tokens as slice data.subtractSlicedrops a token-only remainder: it is drift between two scans of the same calls, not usage.A newer token-only slice now wins over an older one with calls, as the newer-wins rule intends, instead of the two being added.
No cache version bump, so this does not collide with #1786 or #1787.
Tests: two new cases in
tests/daily-cache-carry-forward.test.ts; typecheck and the daily-cache suites pass.