Skip to content

fix: include reasoning_content in OpenAI adapter for DeepSeek multi-turn compatibility#318

Open
Jackson57279 wants to merge 1 commit into
inngest:mainfrom
Jackson57279:fix/deepseek-reasoning-content
Open

fix: include reasoning_content in OpenAI adapter for DeepSeek multi-turn compatibility#318
Jackson57279 wants to merge 1 commit into
inngest:mainfrom
Jackson57279:fix/deepseek-reasoning-content

Conversation

@Jackson57279
Copy link
Copy Markdown

Summary

  • Fix OpenAI request parser to include reasoning_content field in assistant messages for DeepSeek multi-turn compatibility
  • Add tests for reasoning content injection into text and tool_call messages

Context

Fixes #317

When using DeepSeek models via the OpenAI-compatible adapter, multi-turn conversations were broken because the reasoning_content field 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.

…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)
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: 2434160

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

关于多轮调用deepseek-v4-pro出现的缺少reasoning_content字段问题,我这里有一个解决办法

1 participant