Repository navigation
fix(responses): avoid duplicate spend logs in async chat bridge - #42977
Closed
sorgfresser wants to merge 2 commits into
Closed
sorgfresser wants to merge 2 commits into
sorgfresser wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
sorgfresser
force-pushed
the
litellm_fix_responses_duplicate_spend
branch
from
September 24, 2026 16:29
b96edf7 to
03d8595
Compare
sorgfresser
marked this pull request as ready for review
September 24, 2026 16:40
Contributor
|
sorgfresser
force-pushed
the
litellm_fix_responses_duplicate_spend
branch
from
September 24, 2026 22:57
03d8595 to
23fdbe7
Compare
sorgfresser
force-pushed
the
litellm_fix_responses_duplicate_spend
branch
from
September 27, 2026 16:35
23fdbe7 to
f9703e3
Compare
Contributor
|
Thanks Simon. #44508 fixed this on main (in v1.106.0-rc.1), and your spend-once test passes there without the handler change, so I'm closing this as superseded |
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.
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a non-streaming Responses request succeeds, but the proxy records its spend twice
POST /v1/responsesthrough a chat-only provider/ui/?page=logsand sees two rows for the same call IDAfter: the same request succeeds and produces one spend record
POST /v1/responsesthrough a chat-only provider/ui/?page=logsand sees one row for the call IDPre-Submission checklist
Screenshots / Proof of Fix
Before (bf01870)
Expected one spend log, got 2After (f9703e3)
6 passedType
Bug Fix
Final Attestation