fix: avoid mutable default in InfinityError headers - #39299
dajiaohuang wants to merge 1 commit into
Conversation
…ault argument Fixes BerriAI#38909 - InfinityError uses a mutable default argument for headers, shared across all instances. Changed headers default from {} to None to match the convention used by BaseLLMException, OpenAIError, and AnthropicError.
Greptile SummaryUpdates
Confidence Score: 5/5The PR appears safe to merge with no actionable regressions identified. The new default follows the established optional-header contract, while existing callers and downstream exception handling support
|
| Filename | Overview |
|---|---|
| litellm/llms/infinity/common_utils.py | Safely replaces the mutable headers default with None; the base exception accepts it and downstream handling normalizes absent headers. |
Reviews (1): Last reviewed commit: "fix: InfinityError uses None default for..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Updated title to fix: avoid mutable default in InfinityError headers. The recorded OSV failure is baseline dependency exposure from pypdf 6.15.0 and tornado 6.5.7 in uv.lock (5 known vulnerabilities; no changed dependency files), so this PR does not introduce it. |
|
Closing as superseded by #39303, which consolidates this InfinityError fix with the related mutable-default fixes. |
Description
Fixes #38909 - InfinityError uses a mutable default argument for headers, shared across all instances.
Changes
Testing
The issue reporter provided a reproduction case: