Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion litellm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4818,7 +4818,7 @@ def add_provider_specific_params_to_optional_params(
)
is False
):
extra_body = passed_params.pop("extra_body", None) or {}
extra_body = dict(passed_params.pop("extra_body", None) or {})
for k in passed_params.keys():
if k not in openai_params and passed_params[k] is not None:
extra_body[k] = passed_params[k]
Comment on lines +4821 to 4824

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing regression test for the mutation bug

The PR description explains the bug clearly and provides a manual reproduction, but no automated test was added to guard against future regressions. Without a test, a future refactor (e.g., changing the dict() call back to the or {} pattern, or switching to copy()) could silently reintroduce the mutation. A test calling add_provider_specific_params_to_optional_params twice with the same non-empty extra_body and asserting the original dict is unchanged after the second call would provide this coverage.

Rule Used: What: Ensure that any PR claiming to fix an issue ... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Expand Down
Loading