Problem (one or two sentences)
When using a model that supports reasoning (e.g., DeepSeek R1) through the LiteLLM proxy, the reasoning_content of previous assistant messages is dropped from the conversation history sent to the API, causing the model to lose its train of thought in subsequent turns.
Context (who is affected and when)
This affects any user connecting to reasoning-capable models (like DeepSeek Reasoner) via the LiteLLM provider. It happens during multi-turn conversations where the assistant utilizes tool calls followed by a user message.
Reproduction steps
- Start Zoo Code and select "LiteLLM" as the API Provider.
- Connect to a reasoning-supported model (e.g.,
deepseek-reasoner) via LiteLLM.
- Ask the model to perform a task that requires a tool call (e.g., "Read this file and then explain it").
- After the tool is executed and the result is returned, check the payload of the next API request.
- Observe that the previous turn's reasoning block is missing.
Expected result
The reasoning_content generated by the model should be preserved in the conversation history and merged properly with tool results so that the API does not drop it in subsequent requests.
Actual result
The conversation history falls back to standard OpenAI formatting, which fails to merge tool results with text properly, causing the upstream API (like DeepSeek) to drop all previously recorded reasoning_content.
Variations tried (optional)
No response
App Version
v3.68.0
API Provider (optional)
LiteLLM
Model Used (optional)
No response
Zoo Code Task Links (optional)
No response
Relevant logs or errors (optional)
Problem (one or two sentences)
When using a model that supports reasoning (e.g., DeepSeek R1) through the LiteLLM proxy, the reasoning_content of previous assistant messages is dropped from the conversation history sent to the API, causing the model to lose its train of thought in subsequent turns.
Context (who is affected and when)
This affects any user connecting to reasoning-capable models (like DeepSeek Reasoner) via the LiteLLM provider. It happens during multi-turn conversations where the assistant utilizes tool calls followed by a user message.
Reproduction steps
deepseek-reasoner) via LiteLLM.Expected result
The
reasoning_contentgenerated by the model should be preserved in the conversation history and merged properly with tool results so that the API does not drop it in subsequent requests.Actual result
The conversation history falls back to standard OpenAI formatting, which fails to merge tool results with text properly, causing the upstream API (like DeepSeek) to drop all previously recorded
reasoning_content.Variations tried (optional)
No response
App Version
v3.68.0
API Provider (optional)
LiteLLM
Model Used (optional)
No response
Zoo Code Task Links (optional)
No response
Relevant logs or errors (optional)