fix(llm): forward thinking param to LiteLLM completion for all providers#5720
Open
Beandon13 wants to merge 1 commit intocrewAIInc:mainfrom
Open
fix(llm): forward thinking param to LiteLLM completion for all providers#5720Beandon13 wants to merge 1 commit intocrewAIInc:mainfrom
thinking param to LiteLLM completion for all providers#5720Beandon13 wants to merge 1 commit intocrewAIInc:mainfrom
Conversation
…iders
The `thinking` field was declared on the `LLM` model but never added to
the `params` dict in `_prepare_completion_params`, causing it to be
silently dropped for OpenRouter, DeepSeek, Ollama, and every other
provider that goes through LiteLLM directly. Only the native
AnthropicCompletion path included `thinking`.
Add `"thinking": self.thinking` alongside `reasoning_effort` in
`_prepare_completion_params` so that LLM(model="openrouter/anthropic/…",
thinking={...}) propagates the extended-thinking config correctly.
Closes crewAIInc#5537
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thinkingfield was defined onLLM(line 346) but never included in_prepare_completion_params, so it was silently dropped for every provider that uses LiteLLM directly (OpenRouter, DeepSeek, Ollama, etc.)AnthropicCompletioncode path correctly forwardedthinking; users ofopenrouter/anthropic/claude-*or any other provider got nothing"thinking": self.thinkingalongside"reasoning_effort": self.reasoning_effortso the param reaches LiteLLM for all providersCloses #5537
Testing