fix: include reasoning_content in OpenAI adapter for DeepSeek multi-turn compatibility#318
Open
Jackson57279 wants to merge 1 commit into
Open
Conversation
…urn compatibility The OpenAI request parser was filtering out reasoning messages entirely, which broke multi-turn conversations with DeepSeek models that require the reasoning_content field to be passed back in subsequent requests. Now reasoning content is captured and attached to the next assistant message (text or tool_call), enabling proper DeepSeek reasoning mode across multiple turns. Co-authored-by: opencode (qwen3.6-plus-free)
|
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
reasoning_contentfield in assistant messages for DeepSeek multi-turn compatibilityContext
Fixes #317
When using DeepSeek models via the OpenAI-compatible adapter, multi-turn conversations were broken because the
reasoning_contentfield from previous responses was being filtered out entirely. DeepSeek's reasoning mode requires this field to be passed back in subsequent requests.This change captures reasoning content and attaches it to the next assistant message (text or tool_call), enabling proper DeepSeek reasoning mode across multiple turns.
This contribution was created using opencode with the qwen3.6-plus-free model.