Skip to content

Always send modelUsage on the claude-code-usage service message - #2146

Merged
flin-8 merged 1 commit into
mainfrom
franklin/sf-3393-add-missing-property-to-claude-code-usage-service-message
Aug 20, 2026
Merged

Always send modelUsage on the claude-code-usage service message#2146
flin-8 merged 1 commit into
mainfrom
franklin/sf-3393-add-missing-property-to-claude-code-usage-service-message

Conversation

@flin-8

@flin-8 flin-8 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes SF-3393

claude-code-usage only carried modelUsage when 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.

⚠️ Does this change require a corresponding Server Change?

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

@flin-8 flin-8 self-assigned this Aug 20, 2026
@flin-8
flin-8 merged commit 988f470 into main Aug 20, 2026
29 checks passed
@flin-8
flin-8 deleted the franklin/sf-3393-add-missing-property-to-claude-code-usage-service-message branch August 20, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants