Always send modelUsage on the claude-code-usage service message - #2146
Merged
flin-8 merged 1 commit intoAug 20, 2026
Merged
Conversation
sathvikkumar-octo
approved these changes
Aug 20, 2026
flin-8
deleted the
franklin/sf-3393-add-missing-property-to-claude-code-usage-service-message
branch
August 20, 2026 09:46
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.
Fixes SF-3393
claude-code-usageonly carriedmodelUsagewhen there was per-model usage to report, but the server treats that property as required. A run that ends before any model round-trip (auth failure, cancellation, injection check disabled) sends summary-only and the server-side mapper throws, dropping the whole service message batch — including the transcript.Now always sends the attribute, empty list included, so the run summary still gets through. Logs a verbose line when there's no per-model usage.
No — the server already requires
modelUsage; this makes Calamari always send it. A separate server-side change to stop the mapper throwing on old agents is worth doing, tracked by LEV-1350.🤖 Generated with Claude Code