fix(hermes): attribute mixed-session usage by model - #170
Merged
Conversation
pitimon
force-pushed
the
fix/169-hermes-mixed-model-usage
branch
2 times, most recently
from
August 6, 2026 00:17
185ac4f to
9e7e976
Compare
Read session_model_usage when available, track cumulative snapshots per session and model, and preserve legacy cursors without replaying lifetime totals.
pitimon
force-pushed
the
fix/169-hermes-mixed-model-usage
branch
from
August 6, 2026 00:25
9e7e976 to
72511ef
Compare
Owner
Author
|
Release and live verification complete:
Follow-up publish snapshot PR #171 merged. |
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.
Summary
session_model_usagewhen available and aggregate usage by(session, model)across billing/task dimensionslast_seentimestamp for bucket placement0.39.48Root cause
Hermes records mixed-model sessions in
session_model_usage, while TokenTracker only read aggregate counters plus the singlesessions.modelvalue. Tokens produced after an in-session model switch were therefore counted but attributed to the original/default model.Verification
eventsAggregated1 instead of 2)npm run ci:localpassesMigration note
Existing aggregate cursors are baselined once to avoid double-counting. Previously misattributed historical tokens remain in their old model bucket; new per-model growth is attributed correctly after adoption.
Closes #169