Replies: 2 comments
|
thinking-mode 工具轮次空 reasoning → 400——和 #739 完全同族(serializeAssistant 省略空 reasoning 字段)。 已确认是 bug(官方适配器同场景不触发),我们第 6 章坑位 #8 有完整根因 + 验证点:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/06-advanced.md |
|
Cross-route measurement that closes off the workaround space and (hopefully) raises the priority of the adapter fix you isolated: We fed an assistant history message carrying both a thinking block and a tool call through the real pi-ai transform (
Implication for this bug: a thinking-mode backend that requires the Scope note: our live leg runs a non-thinking model (thinking mode 400s are exactly the unfixed part); the transform-side conclusion is version-stable. |
Uh oh!
There was an error while loading. Please reload this page.
Bug 2: DeepSeek thinking-mode
reasoning_contentnot passed back when a tool-call assistant message has empty reasoning → HTTP 400INVALID_REQUESTEnvironment
reasoningEffort: max(also observed at high)deepseek-official(@deepseek-ai/dsh-llm-deepseek)Steps to reproduce
deepseek-v4-prowithreasoningEffort: maxin settings.(The DeepSeek API rejects the request while validating the conversation history.)
Root cause
DeepSeek's thinking mode requires that any assistant message carrying
tool_callsmust also pass back itsreasoning_content. The adapterserializeAssistantindsh-llm-deepseek/lib/index.jsonly includesreasoning_contentwhen both tool calls AND reasoning are present:When a historical assistant message has tool calls but its reasoning block is empty/missing (e.g. persisted under high/max reasoning effort where reasoning blocks may not be stored), the adapter emits
tool_callswithoutreasoning_content→ DeepSeek returns 400INVALID_REQUEST.Direct API probe confirms: sending history with an assistant
tool_callsmessage that lacksreasoning_contentyields"The reasoning_content in the thinking mode must be passed back to the API."Workaround
reasoningEffortfrommaxtohighand starting a fresh session avoids the immediate failure, but the underlying serialization gap remains.Suggested fix
Always include
reasoning_content(even if empty string) on assistant messages that carrytool_calls, per DeepSeek thinking-mode passback requirements:All reactions