Skip to content

fix(framework): omit costUsd when the agent reports tokens but no price#617

Merged
suleimansh merged 1 commit into
mainfrom
suleimansh/fix/driver-usage-omit-cost
Jul 16, 2026
Merged

fix(framework): omit costUsd when the agent reports tokens but no price#617
suleimansh merged 1 commit into
mainfrom
suleimansh/fix/driver-usage-omit-cost

Conversation

@suleimansh

@suleimansh suleimansh commented Jul 16, 2026

Copy link
Copy Markdown
Member

The Claude Code driver's parseUsage set costUsd: 0 when a result line carried token usage but no total_cost_usd. DriverUsage.costUsd is documented as omitted (never 0) in that case: the budget cap reads 0 as "free" and undefined as "unknown" (#540), and the Codex driver already omits it. Now the field is omitted when there's no finite price, matching the contract and the other driver. Claude runs that report a price are unchanged.

Regression test added (StreamJsonParser: usage present, no price -> costUsd absent). Changeset: patch.

@suleimansh suleimansh added bug Something isn't working priority: medium Worth doing, not urgent the-framework ♻️ labels Jul 16, 2026
@suleimansh suleimansh self-assigned this Jul 16, 2026
@suleimansh
suleimansh merged commit f1ff0d2 into main Jul 16, 2026
2 checks passed
@suleimansh
suleimansh deleted the suleimansh/fix/driver-usage-omit-cost branch July 16, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Worth doing, not urgent the-framework ♻️

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant