fix: add reasoning field fallback in ChatCompletionsTransport.parse (#1731)#1736
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0e62acb94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| reasoning_delta = _get_value(delta, "reasoning_content") or _get_value( | ||
| message, "reasoning_content" | ||
| ) or "" | ||
| reasoning_delta = ( |
There was a problem hiding this comment.
Close the new reasoning_delta expression
This assignment opens a parenthesized expression but never closes it before the following return, so importing this module now fails with SyntaxError: '(' was never closed (confirmed with python -m py_compile helpers/litellm_transport.py). Because helpers/litellm_transport.py is a core transport helper, this blocks any path that imports it rather than just the new reasoning fallback.
Useful? React with 👍 / 👎.
Closes #1731
Summary
ChatCompletionsTransport.parse in helpers/litellm_transport.py only read reasoning from the legacy reasoning_content field. Newer vLLM / OpenAI-compatible backends (e.g. Qwen3.6 on vLLM) return reasoning under the newer reasoning field instead, causing reasoning to be silently dropped.
Fix
Added fallback checks for delta.reasoning and message.reasoning after the existing reasoning_content checks. The old field is checked first so existing providers are unaffected.
Verification