Skip to content

Conversation

@jooray
Copy link

@jooray jooray commented Jan 29, 2026

Add reasoning_key field to LLMProvider configuration class to enable preservation of reasoning_content in multi-turn tool calling with reasoning models through third party APIs such as DeepSeek, Venice AI, etc.

This makes Kimi-K2.5 work through venice.ai for example.

Changes:

  • config.py: Add reasoning_key: str | None = None field to LLMProvider
  • llm.py: Pass reasoning_key parameter when instantiating OpenAILegacy provider
  • docs: Document the new configuration option in English and Chinese docs
  • tests: Add unit tests for the new functionality

This fixes 400 errors like 'thinking is enabled but reasoning_content is missing in assistant tool call message' when using reasoning models with openai_legacy provider.

  • 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

…dels

Add reasoning_key field to LLMProvider configuration class to enable
preservation of reasoning_content in multi-turn tool calling with
reasoning models (DeepSeek, Venice AI, etc.).

Changes:
- config.py: Add reasoning_key: str | None = None field to LLMProvider
- llm.py: Pass reasoning_key parameter when instantiating OpenAILegacy provider
- docs: Document the new configuration option in English and Chinese docs
- tests: Add unit tests for the new functionality

This fixes 400 errors like 'thinking is enabled but reasoning_content
is missing in assistant tool call message' when using reasoning models
with openai_legacy provider.
Copilot AI review requested due to automatic review settings January 29, 2026 13:04
Copy link

@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 flags.

Open in Devin Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for reasoning models (like DeepSeek, Kimi-K2.5 through Venice AI) that return reasoning/thinking content in custom fields when using the openai_legacy provider. The reasoning_key configuration parameter enables proper preservation and transmission of reasoning content across multi-turn conversations with tool calling.

Changes:

  • Added reasoning_key field to LLMProvider configuration class
  • Updated create_llm() to pass reasoning_key to OpenAILegacy provider
  • Added comprehensive tests for both scenarios (with and without reasoning_key)
  • Documented the new feature in both English and Chinese documentation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/kimi_cli/config.py Added optional reasoning_key field to LLMProvider class for specifying custom reasoning content field names
src/kimi_cli/llm.py Pass reasoning_key parameter when instantiating OpenAILegacy provider
tests/core/test_create_llm.py Added two tests verifying reasoning_key is correctly passed and defaults to None
docs/en/configuration/providers.md Added documentation section explaining reasoning_key configuration with Venice AI and DeepSeek examples
docs/zh/configuration/providers.md Added Chinese translation of reasoning_key documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant