Summary
deepseek-v4-pro agents fail every multi-turn tool-call conversation with:
400 {"error":{"message":"The reasoning_content in the thinking mode must be passed back to the API.","type":"invalid_request_error"}}
Root cause
is_deepseek_v4_thinking_with_tools (crates/librefang-llm-drivers/src/drivers/openai.rs) only matches deepseek-v4-flash. deepseek-v4-pro was deliberately excluded with the comment "V4 Pro is reported as working out-of-the-box (#4842 workaround section) — must not be lumped in with V4 Flash" and an explicit assert!(!...) test.
Production proves that assumption wrong (or DeepSeek changed the contract): deepseek-v4-pro has the same echo requirement as V4 Flash — once a tool-call thinking turn is in the history, the next request must echo its reasoning_content, or DeepSeek returns 400. Because V4 Pro isn't matched, it never gets ReasoningEchoPolicy::Echo, so the content is dropped and every subsequent turn 400s.
Impact
A delegated agent running deepseek-v4-pro dies on its first tool-call follow-up turn: agent_send (blocking and async) and shared-queue tasks to it never complete. A sibling agent on the same model only avoided it by keeping a long enough history window that it never trimmed off the thinking turn.
Fix
Match deepseek-v4-pro in is_deepseek_v4_thinking_with_tools (alongside Flash) so the Echo policy applies. PR incoming.
Summary
deepseek-v4-proagents fail every multi-turn tool-call conversation with:Root cause
is_deepseek_v4_thinking_with_tools(crates/librefang-llm-drivers/src/drivers/openai.rs) only matchesdeepseek-v4-flash.deepseek-v4-prowas deliberately excluded with the comment "V4 Pro is reported as working out-of-the-box (#4842 workaround section) — must not be lumped in with V4 Flash" and an explicitassert!(!...)test.Production proves that assumption wrong (or DeepSeek changed the contract):
deepseek-v4-prohas the same echo requirement as V4 Flash — once a tool-call thinking turn is in the history, the next request must echo itsreasoning_content, or DeepSeek returns 400. Because V4 Pro isn't matched, it never getsReasoningEchoPolicy::Echo, so the content is dropped and every subsequent turn 400s.Impact
A delegated agent running
deepseek-v4-prodies on its first tool-call follow-up turn:agent_send(blocking and async) and shared-queue tasks to it never complete. A sibling agent on the same model only avoided it by keeping a long enough history window that it never trimmed off the thinking turn.Fix
Match
deepseek-v4-proinis_deepseek_v4_thinking_with_tools(alongside Flash) so theEchopolicy applies. PR incoming.