fix(openai_compat): clarify DeepSeek reasoning replay rules

This commit is contained in:
lc6464 2026-04-29 12:57:00 +08:00
parent ee3c815aff
commit 85f9d21151
No known key found for this signature in database
GPG key ID: 53C61B42FEC71D6D

View file

@ -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 = ""
}