400 "reasoning_content in the thinking mode must be passed back to the API" — DeepSeek thinking models (deepseek-flash) fail on multi-turn (v1.0.87-0)
#208681
Replies: 2 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Hit the same wall with deepseek-flash through an OpenAI-compatible endpoint, not on Copilot specifically but the error is identical, so this is worth confirming as a general pattern rather than something unique to your setup. What's happening is that DeepSeek's reasoning models (same story with most "thinking mode" models, OpenRouter's deepseek-v4-flash included) return Until the fix lands in Copilot's provider adapter, a couple of things that work as a stopgap if you're scripting around this or building your own adapter:
|
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Copilot Agent Mode
Body
Describe the bug
When using a DeepSeek thinking model (
deepseek-flash) against the DeepSeek API, the first request in a conversation can succeed, but every subsequent request in the same conversation fails with:400 The
reasoning_contentin the thinking mode must be passed back to the API.The DeepSeek API requires the
reasoning_contentfield returned in assistant messages to be echoed back verbatim in the assistant message of subsequent requests once thinking mode has been used. Copilot's provider adapter appears to drop this field when persisting assistant turns, so the follow-up request is rejected with HTTP 400. It is triggered more easily by agent flows that issue several internal/tool requests within one turn.Affected version
deepseek-flashhttps://api.deepseek.com)Steps to reproduce the behavior
deepseek-flash(e.g.COPILOT_PROVIDER_BASE_URL=https://api.deepseek.com,COPILOT_PROVIDER_TYPE=openai,COPILOT_MODEL=deepseek-flash).Expected behavior
Copilot preserves the
reasoning_contentreturned by DeepSeek and includes it in the assistant message of subsequent requests, as the DeepSeek API requires.Actual behavior
reasoning_contentis omitted from the conversation history sent upstream, so the DeepSeek API rejects subsequent turns with HTTP 400 and the conversation cannot proceed.Additional context
deepseek/deepseek-v4-flash).reasoning_contentfrom previous assistant turns must be passed back in subsequent requests.reasoning_contentin the assistant message objects sent upstream for DeepSeek thinking models.Thank you.
All reactions