Skip to content

[codex] fix deepseek thinking config for streams#808

Open
k8scat wants to merge 1 commit into
cloudwego:mainfrom
k8scat:fix/deepseek-thinking-config-stream
Open

[codex] fix deepseek thinking config for streams#808
k8scat wants to merge 1 commit into
cloudwego:mainfrom
k8scat:fix/deepseek-thinking-config-stream

Conversation

@k8scat
Copy link
Copy Markdown

@k8scat k8scat commented Apr 28, 2026

Summary

  • forward DeepSeek ThinkingConfig into stream chat completion requests
  • add regression coverage for stream requests carrying thinking config

Root Cause

generateStreamRequest builds a stream request from the non-stream request but did not copy the Thinking field, so ChatModelConfig.ThinkingConfig was applied to Generate but dropped for Stream.

Validation

  • git diff --check main...HEAD
  • GOTOOLCHAIN=go1.24.1 go test ./... -count=1 -gcflags="all=-N -l" in components/model/deepseek

Fixes #807

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

@k8scat k8scat marked this pull request as ready for review April 28, 2026 05:37
Copilot AI review requested due to automatic review settings April 28, 2026 05:37
Copy link
Copy Markdown

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

Fixes a DeepSeek streaming bug where ThinkingConfig was applied to non-stream Generate requests but inadvertently dropped from Stream requests.

Changes:

  • Forward Thinking from the non-stream request into deepseek.StreamChatCompletionRequest in generateStreamRequest.
  • Add a regression test ensuring stream requests carry the ThinkingConfig.

Reviewed changes

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

File Description
components/model/deepseek/deepseek.go Copies Thinking into the stream request so DeepSeek “thinking mode” is preserved for streaming.
components/model/deepseek/deepseek_test.go Adds a regression test that captures the stream request and asserts Thinking.Type is forwarded.

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

@k8scat
Copy link
Copy Markdown
Author

k8scat commented Apr 28, 2026

@JonXSnow 大佬帮忙review下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

deepseek thinking config 没有应用

3 participants