fix(llm): avoid implicit reasoning-off for responses#1358
Merged
RealKai42 merged 5 commits intoMoonshotAI:mainfrom Mar 11, 2026
Merged
fix(llm): avoid implicit reasoning-off for responses#1358RealKai42 merged 5 commits intoMoonshotAI:mainfrom
RealKai42 merged 5 commits intoMoonshotAI:mainfrom
Conversation
PR Description: - omit reasoning and include unless reasoning_effort is explicitly set on OpenAI Responses requests - keep thinking=False from mapping to with_thinking(off) for openai_responses providers - add regression coverage in kosong snapshot tests and create_llm tests Reviewer Notes: - this preserves provider-default reasoning behavior for Responses-compatible endpoints that require reasoning - the change matches the safety invariant carried by our local AI Now and builtin-agent patches
Contributor
Author
|
gently ping but not pushy, we used this patch locally in production already and upstream here :) |
This was referenced Mar 10, 2026
Signed-off-by: Kai <me@kaiyi.cool>
This was referenced Mar 12, 2026
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.
PR Description:
Reviewer Notes:
Related Issue
None.
Description
This fixes an OpenAI Responses transport mismatch for providers and models that require reasoning by default.
Previously:
create_llm(..., thinking=False)mappedopenai_responsesproviders towith_thinking("off")OpenAIResponses.generate()always sent areasoningblock, even when no explicit reasoning level was requestedThat request shape can be interpreted as disabling reasoning, which breaks Responses-compatible endpoints that require reasoning and returns a 400 error.
This change:
reasoningandincludeunlessreasoning_effortis explicitly setopenai_responseswhen no reasoning level is requestedthinking=Falsetowith_thinking("off")foropenai_responseskosongsnapshot coverage andkimi_clicreate_llmcoverageChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.