Skip to content

fix(extensions): nest extra_body on the any-llm chat path - #4544

Merged
seratch merged 1 commit into
openai:mainfrom
hsusul:fix/any-llm-chat-extra-body-nested
Aug 20, 2026
Merged

fix(extensions): nest extra_body on the any-llm chat path#4544
seratch merged 1 commit into
openai:mainfrom
hsusul:fix/any-llm-chat-extra-body-nested

Conversation

@hsusul

@hsusul hsusul commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request nests ModelSettings.extra_body on the AnyLLM chat Completions path instead of flattening it into top-level acompletion kwargs.

The Responses path and LiteLLM already copy extra_body under extra_body. The chat helper merged the mapping into kwargs, so provider fields such as cached_content became top-level arguments and a nested temperature collided with the explicit temperature= parameter (TypeError: got multiple values for keyword argument 'temperature'). Empty extra_query and metadata mappings are now forwarded when set, matching the Responses helper. extra_args still flatten as top-level kwargs.

Test plan

  • uv run pytest -q tests/models/test_any_llm_model.py
  • make format && make lint && make typecheck
  • Confirmed extra_body stays nested, is copied, and does not override temperature

Issue number

N/A

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed format, lint, typecheck, and focused AnyLLM tests pass
  • If using Codex, I've run /review before submitting this PR

Flattening extra_body into acompletion kwargs collided with named
parameters such as temperature and diverged from the Responses and
LiteLLM adapters.
@seratch seratch added this to the 0.22.x milestone Aug 20, 2026
@seratch
seratch merged commit 17ba331 into openai:main Aug 20, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants