Repository navigation
Cancelled calls keep the money that was measured - #2302
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Interim usage was suppressed when session callers had no billing sink. Preserve it as the fallback for the existing reconciliation door and retain provider generation identities for helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Raw StreamComplete treated an error finish as a complete billed answer, suppressing the reconciliation sink. Use the same success predicate for billing and usage completion. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The archived worker finding is false as a ledger-loss claim: all nine provider adjustments already exist as reconciled usage rows, including both charges totaling $0.0167028 on 2-old. Independent scripted tests exposed the interim and raw-stream settlement defects fixed here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use receipt price presence to retain measured interim spend once while allowing real receipt prices, including zero, to win. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What changes
A cancelled, failed or timed-out model call can still have been billed. This keeps what was measured.
measured spend lost: got $0.00, want $0.07.Validation
TestTokenOnlyReceiptKeepsMeasuredSpendfailed with the line above before the fix.TestCancelledHelperRetryBooksEachAttemptOnce: a cancelled helper retry writes exactly two paid rows.internal/provider,internal/session,internal/manual,cmd/codeaf, go vet: pass, apart from the known red tests on the base.TestAppChatsExistingBeforePairL1failed once on cleanup in the full run and passed alone three times.Limits
🤖 Generated with Claude Code