From 85f9d211518c485844092afbdef6b3647a4790c5 Mon Sep 17 00:00:00 2001 From: lc6464 <64722907+lc6464@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:57:00 +0800 Subject: [PATCH] fix(openai_compat): clarify DeepSeek reasoning replay rules --- pkg/providers/openai_compat/provider.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/providers/openai_compat/provider.go b/pkg/providers/openai_compat/provider.go index c3733ce3a..be3e77a43 100644 --- a/pkg/providers/openai_compat/provider.go +++ b/pkg/providers/openai_compat/provider.go @@ -270,6 +270,10 @@ func filterDeepSeekReasoningTurn(messages []Message) []Message { } cloned := msg + // DeepSeek thinking-mode replay only requires reasoning_content for + // turns that participate in a tool interaction round. For plain + // assistant turns between two user messages, the docs say the API will + // ignore reasoning_content on replay, so we strip it here. if cloned.Role == "assistant" && strings.TrimSpace(cloned.ReasoningContent) != "" && !hasToolInteraction { cloned.ReasoningContent = "" }