Repository navigation
fix(server): Grok usage counts turns from resumed sessions #30694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juliusmarminge
merged 10 commits into
pingdotgg:main
from
saphid:fix/grok-usage-resumed-prompt-ids
Nov 15, 2026
+117
−10
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e3e79e1
fix(server): Grok usage counts turns from resumed sessions
saphid 66c621d
fix(server): carry saved Grok usage keys into the time-keyed form
saphid 5b9b8ad
merge(main): retain streamed usage caches and Grok migration tests
github-actions[bot] 135c9e0
Merge remote-tracking branch 'github/main' into pr-30694
maria-rcks ac57b7c
Merge current main and migrate Grok turn keys safely
github-actions[bot] 63b6eb2
Merge main into Grok resumed-session usage fix
github-actions[bot] 81f0d16
Merge origin/main into fix/grok-usage-resumed-prompt-ids
github-actions[bot] 4afdc16
Merge remote-tracking branch 'origin/main' into fix/grok-usage-resume…
juliusmarminge 65c0725
fix(server): live Grok turns win over saved pre-v17 maxima
juliusmarminge fcc9760
fix(server): Grok copies keep the real turn in any source order
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High
usage/usageScanCache.ts:276A moved Grok transcript can inflate usage because this migration assigns a previously merged legacy record to the first turn’s new key. If the cached record already combines two turns at $2, aggregation merges it with the live first turn at $1 and then counts the live second turn at $2, reporting $4 instead of $3. Reconcile reduced legacy records against the reparsed transcript rather than treating the migrated key as an exact copy.
🤖 Copy this AI Prompt to have your agent fix this: