Skip to content

feat: preserve provider usage across turn outcomes - #553

Merged
GraciousGazelles merged 2 commits into
mainfrom
fix/provider-usage-signed-411-v2
Jul 30, 2026
Merged

GraciousGazelles merged 2 commits into
mainfrom
fix/provider-usage-signed-411-v2

Conversation

@GraciousGazelles

Copy link
Copy Markdown
Collaborator

Signed current-base replacement for #411. Preserves exact provider-observed usage across completed, interrupted, replaced, budget-limited, steering, and compaction turn paths while retaining legacy rollout compatibility.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements provider-observed turn usage tracking by aggregating exact provider-reported token usage from successful response completions into TurnCompleteEvent and TurnAbortedEvent. The feedback identifies two valid issues: first, the cache_write_input_tokens field is missing from the token usage aggregation logic in TurnContext::record_provider_usage; second, the newly added justfile target references a non-existent test name (resume_accepts_persisted_turn_complete_without_provider_usage) instead of the correct aborted_provider_usage_is_durable_isolated_and_legacy_compatible test.

Comment thread justfile Resolved
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 6707b2a Jul 30, 2026
127 of 129 checks passed
@GraciousGazelles
GraciousGazelles deleted the fix/provider-usage-signed-411-v2 branch July 30, 2026 19:28
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.

1 participant