Skip to content

fix(llm): avoid implicit reasoning-off for responses#1358

Merged
RealKai42 merged 5 commits intoMoonshotAI:mainfrom
wey-gu:main
Mar 11, 2026
Merged

fix(llm): avoid implicit reasoning-off for responses#1358
RealKai42 merged 5 commits intoMoonshotAI:mainfrom
wey-gu:main

Conversation

@wey-gu
Copy link
Contributor

@wey-gu wey-gu commented Mar 6, 2026

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

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) mapped openai_responses providers to with_thinking("off")
  • OpenAIResponses.generate() always sent a reasoning block, even when no explicit reasoning level was requested

That request shape can be interpreted as disabling reasoning, which breaks Responses-compatible endpoints that require reasoning and returns a 400 error.

This change:

  • omits reasoning and include unless reasoning_effort is explicitly set
  • preserves provider-default reasoning behavior for openai_responses when no reasoning level is requested
  • stops mapping thinking=False to with_thinking("off") for openai_responses
  • adds regression tests in both kosong snapshot coverage and kimi_cli create_llm coverage

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

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
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@wey-gu
Copy link
Contributor Author

wey-gu commented Mar 6, 2026

gently ping but not pushy, we used this patch locally in production already and upstream here :)

@RealKai42

@RealKai42 RealKai42 merged commit f6bc628 into MoonshotAI:main Mar 11, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants