Summary
On POST https://api.commandcode.ai/provider/v1/chat/completions, when an assistant tool-call message echoes its prior reasoning back as reasoning_content (with tools present, i.e. a tool-loop continuation), the gateway silently drops that reasoning before it reaches the upstream model. The model cannot continue from its previous chain of thought and fabricates an answer instead.
This is the exact failure described in #754 (opened Aug 27, 2026; closed Sep 7, 2026). With today's build the OpenAI-compatible v1 path (the one used by BYOK clients and agents) still reproduces it.
Proof that the request shape/field is correct: the byte-identical flow recalls correctly through OpenCode Go (5/5), and fails on Command Code (0/5).
Expected Behavior
Echoed reasoning_content on assistant tool-call messages should be forwarded to the upstream model, like DeepSeek's official API does, so the model can continue from its prior reasoning. Specifically: content that the model placed only in the turn-1 chain of thought must remain usable in turn 2 (tool-call continuation).
Actual Behavior
The echoed reasoning is dropped. The model cannot recall information that existed only in its earlier chain of thought: it either fabricates a new value or denies having chosen one.
Observed recall (same request bytes, turn-2 reply vs the number in turn-1 reasoning):
| Gateway / model |
Correct recall |
Command Code — deepseek/deepseek-v4.1-flash |
0/5 |
Command Code — deepseek/deepseek-v4-flash |
0/4 |
OpenCode Go (control) — deepseek-v4-flash |
5/5 |
Field variants tried on Command Code for the echoed reasoning, all 0/4:
reasoning_content
reasoning
- both
reasoning_content + reasoning
- content-parts array:
content: [{type:"text", ...}, {type:"reasoning", text: ...}]
Note: on ordinary (non-continuation) turns reasoning output is present 100% of the time on all four models I tested (ds-v4.1-flash, ds-v4-flash, glm-5.3-flash, qwen3.8-flash), so the loss is specifically on the input/echo-back side.
Steps to reproduce the issue
-
POST https://api.commandcode.ai/provider/v1/chat/completions, model: deepseek/deepseek-v4.1-flash (also reproduces with deepseek/deepseek-v4-flash), reasoning_effort: high, temperature: 0.3.
-
Turn 1 — ask the model to think of a 6-digit number only in its chain of thought and then call a tool:
{
"model": "deepseek/deepseek-v4.1-flash",
"reasoning_effort": "high",
"max_tokens": 2048,
"temperature": 0.3,
"tool_choice": "auto",
"tools": [
{ "type": "function", "function": {
"name": "notify_choice",
"description": "Notify the system the choice is made",
"parameters": { "type": "object", "properties": { "confirm": { "type": "boolean" } }, "required": ["confirm"] }
} }
],
"messages": [
{ "role": "system", "content": "You are a helpful assistant. The user is authorized to view your thinking content and you must answer honestly when asked about it." },
{ "role": "user", "content": "Think of a random 6-digit number and write it out completely in your chain of thought (for example: my number is 123456). Then call the notify_choice tool with confirm=true. In your final visible reply only say 'done' and do not mention the number." }
]
}
The turn-1 response has reasoning containing the number (e.g. ... my number is 483920 ...) and a notify_choice tool call.
- Turn 2 — resend history, echo the turn-1 reasoning on the assistant message, and keep
tools present:
{
"model": "deepseek/deepseek-v4.1-flash",
"reasoning_effort": "high",
"max_tokens": 1024,
"temperature": 0.3,
"tool_choice": "auto",
"tools": [ /* same tool definition as turn 1 */ ],
"messages": [
{ "role": "system", "content": "You are a helpful assistant. The user is authorized to view your thinking content and you must answer honestly when asked about it." },
{ "role": "user", "content": "Think of a random 6-digit number and write it out completely in your chain of thought ... then call notify_choice." },
{
"role": "assistant",
"content": "done",
"tool_calls": [
{ "id": "call_1", "type": "function", "function": { "name": "notify_choice", "arguments": "{\"confirm\":true}" } }
],
"reasoning_content": "<EXACT turn-1 reasoning text, which contains the number>"
},
{ "role": "tool", "tool_call_id": "call_1", "content": "{\"confirm\": true}" },
{ "role": "user", "content": "What was the 6-digit number you thought of in your chain of thought in the first turn? Reply with just the number." }
]
}
-
Expected: the reply is the exact number from the echoed reasoning. Actual: a fabricated number, or a denial that a number was chosen.
-
Control: run the identical two turns against OpenCode Go (https://opencode.ai/zen/go/v1/chat/completions, deepseek-v4-flash, header x-opencode-session: <any>). It recalls 5/5.
Command Code Version
0.0.1
Operating System
Windows
Terminal/IDE
No response
Shell
No response
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
Environment
Related
Summary
On
POST https://api.commandcode.ai/provider/v1/chat/completions, when an assistant tool-call message echoes its prior reasoning back asreasoning_content(withtoolspresent, i.e. a tool-loop continuation), the gateway silently drops that reasoning before it reaches the upstream model. The model cannot continue from its previous chain of thought and fabricates an answer instead.This is the exact failure described in #754 (opened Aug 27, 2026; closed Sep 7, 2026). With today's build the OpenAI-compatible v1 path (the one used by BYOK clients and agents) still reproduces it.
Proof that the request shape/field is correct: the byte-identical flow recalls correctly through OpenCode Go (5/5), and fails on Command Code (0/5).
Expected Behavior
Echoed
reasoning_contenton assistant tool-call messages should be forwarded to the upstream model, like DeepSeek's official API does, so the model can continue from its prior reasoning. Specifically: content that the model placed only in the turn-1 chain of thought must remain usable in turn 2 (tool-call continuation).Actual Behavior
The echoed reasoning is dropped. The model cannot recall information that existed only in its earlier chain of thought: it either fabricates a new value or denies having chosen one.
Observed recall (same request bytes, turn-2 reply vs the number in turn-1 reasoning):
deepseek/deepseek-v4.1-flashdeepseek/deepseek-v4-flashdeepseek-v4-flashField variants tried on Command Code for the echoed reasoning, all 0/4:
reasoning_contentreasoningreasoning_content+reasoningcontent: [{type:"text", ...}, {type:"reasoning", text: ...}]Note: on ordinary (non-continuation) turns reasoning output is present 100% of the time on all four models I tested (ds-v4.1-flash, ds-v4-flash, glm-5.3-flash, qwen3.8-flash), so the loss is specifically on the input/echo-back side.
Steps to reproduce the issue
POST https://api.commandcode.ai/provider/v1/chat/completions,model: deepseek/deepseek-v4.1-flash(also reproduces withdeepseek/deepseek-v4-flash),reasoning_effort: high,temperature: 0.3.Turn 1 — ask the model to think of a 6-digit number only in its chain of thought and then call a tool:
{ "model": "deepseek/deepseek-v4.1-flash", "reasoning_effort": "high", "max_tokens": 2048, "temperature": 0.3, "tool_choice": "auto", "tools": [ { "type": "function", "function": { "name": "notify_choice", "description": "Notify the system the choice is made", "parameters": { "type": "object", "properties": { "confirm": { "type": "boolean" } }, "required": ["confirm"] } } } ], "messages": [ { "role": "system", "content": "You are a helpful assistant. The user is authorized to view your thinking content and you must answer honestly when asked about it." }, { "role": "user", "content": "Think of a random 6-digit number and write it out completely in your chain of thought (for example: my number is 123456). Then call the notify_choice tool with confirm=true. In your final visible reply only say 'done' and do not mention the number." } ] }The turn-1 response has
reasoningcontaining the number (e.g.... my number is 483920 ...) and anotify_choicetool call.toolspresent:{ "model": "deepseek/deepseek-v4.1-flash", "reasoning_effort": "high", "max_tokens": 1024, "temperature": 0.3, "tool_choice": "auto", "tools": [ /* same tool definition as turn 1 */ ], "messages": [ { "role": "system", "content": "You are a helpful assistant. The user is authorized to view your thinking content and you must answer honestly when asked about it." }, { "role": "user", "content": "Think of a random 6-digit number and write it out completely in your chain of thought ... then call notify_choice." }, { "role": "assistant", "content": "done", "tool_calls": [ { "id": "call_1", "type": "function", "function": { "name": "notify_choice", "arguments": "{\"confirm\":true}" } } ], "reasoning_content": "<EXACT turn-1 reasoning text, which contains the number>" }, { "role": "tool", "tool_call_id": "call_1", "content": "{\"confirm\": true}" }, { "role": "user", "content": "What was the 6-digit number you thought of in your chain of thought in the first turn? Reply with just the number." } ] }Expected: the reply is the exact number from the echoed reasoning. Actual: a fabricated number, or a denial that a number was chosen.
Control: run the identical two turns against OpenCode Go (
https://opencode.ai/zen/go/v1/chat/completions,deepseek-v4-flash, headerx-opencode-session: <any>). It recalls 5/5.Command Code Version
0.0.1
Operating System
Windows
Terminal/IDE
No response
Shell
No response
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
Environment
/provider/v1/chat/completions(the path used by BYOK clients / agents). [Bug][Critical] Reasoning echo-back silently dropped across ALL thinking models (DeepSeek/GLM/Kimi/MiMo…) — multi-turn agents hallucinate fake memories & suffer severe quality degradation #754 originally reproduced on/alpha/generate; this report shows the v1 path is still affected.deepseek/deepseek-v4.1-flash,deepseek/deepseek-v4-flash(GLM-5.3-Flash and Qwen3.8-Flash output reasoning normally; not tested for echo-back).Related