feat(config): add reasoning_key field to LLMProvider for reasoning mo…#782
Open
jooray wants to merge 1 commit intoMoonshotAI:mainfrom
Open
feat(config): add reasoning_key field to LLMProvider for reasoning mo…#782jooray wants to merge 1 commit intoMoonshotAI:mainfrom
jooray wants to merge 1 commit intoMoonshotAI:mainfrom
Conversation
…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.
Contributor
There was a problem hiding this comment.
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_keyfield toLLMProviderconfiguration class - Updated
create_llm()to passreasoning_keyto 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.
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.
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:
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.
make gen-changelogto update the changelog.make gen-docsto update the user documentation.