mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-17 22:48:35 +00:00
a2a45ce8c9
* fix: prevent duplicate spend logs in Responses API for non-OpenAI providers Fixes #15740 This fixes a logging duplication bug where using kwargs.pop() removed the litellm_logging_obj before passing kwargs to internal acompletion() calls, causing duplicate spend log entries for providers without native Responses API support (Anthropic, Gemini, etc). By changing from pop() to get(), the logging object is preserved and reused across the internal completion call, preventing duplicate entries and maintaining correct cost tracking. * test: add test for logging object preservation in responses API Verify that litellm_logging_obj is preserved in kwargs when calling responses(), ensuring no duplicate spend log entries are created.