Conversation
google-antigravity 0.1.18 (bumped in 3aa2db3) deprecated Step.usage_metadata: usage is now billed per model invocation on the conversation (conversation.total_usage). The adapter still read the per-step field, so every Antigravity turn since that bump booked no tokens and no cost, and api_calls stayed at 1 because only a usage-bearing step closes a call, so max_turns never tripped. Nothing failed loudly; make verify stayed green. The turn state now takes a cumulative_usage source, books each rise since the last reading as one generation, and books any remainder at finalize, so the per-message buckets still sum to the turn total. The test fakes bill through a meter the way the SDK connection does, and no longer put usage on the Step, so the suite exercises the new source. Verified live on gemini-3.8-flash: 30,774 input / 803 output tokens, 3 generations, 3 counted calls, $0.052 at list price (previously None). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
uipreliga
requested review from
CarlesUIPath,
akshaylive,
bai-uipath and
tmatup
as code owners
September 26, 2026 20:10
|
Claude finished @uipreliga's task in 1m 49s —— View job Code Review in Progress
|
This branch has not been deployed
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
google-antigravity0.1.18 (bumped in #196,3aa2db30) deprecatedStep.usage_metadata. Usage is now billed per model invocation on the conversation (conversation.total_usage), and the per-step field is alwaysNone. The adapter still read the per-step field. The result, since 0.12.7:total_token_usage: null).max_turnsnever tripped on Antigravity.api_callsis incremented when a new MODEL step opens a call, and the call is closed only by a usage-bearing step. With no usage, the first call never closed, so the count stayed at 1.make verifystayed green, because the test fakes still put usage on the Step.Fix
_AntigravityTurnStatetakes acumulative_usagesource (the conversation'stotal_usage). It books each rise since the last reading as one generation, and books any remainder atfinalize. So the per-message buckets still sum to the turn total, and the reconciliation invariant holds._UsageMeter, the same way the SDK connection accumulates usage, and no longer put usage on the Step. The existing scenarios therefore exercise the new source.usage_metadatabooks nothing;.claude/notes/timing.md,docs/agents/HARNESS_PARITY.md)..claude/harness-candidates.md: a static rule cannot see an SDK field go dead, but a one-turn live-telemetry smoke in the harness-bump checklist would have.Verification
make verify: pass (6101 passed; format, lint, pyright, custom rules, docs budget).hello_dateongemini-3.8-flash, before and after the fix:total_token_usage: null,num_turns: 1num_turns: 3, $0.052 at list pricegemini-3.8-flash, 3 repeats): every Antigravity row has tokens and cost.🤖 Generated with Claude Code