fix: passthrough reasoning_content for DeepSeek thinking mode#54
Conversation
DeepSeek's reasoning models return reasoning_content alongside content in API responses. When tool calls are involved, this field must be sent back in subsequent requests, otherwise the API returns 400 Bad Request. Map ReasoningContent in all three conversion points: - toOpenAIMessage: Eino Message -> OpenAI request - toEinoMessage: OpenAI response -> Eino Message - Stream handler: stream delta -> Eino Message
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
DeepSeek reasoning models (e.g.
deepseek-reasoner,deepseek-v4-prowith thinking mode) returnreasoning_contentalongsidecontentin API responses. Per DeepSeek API docs:reasoning_contentfrom assistant messages must be sent back in subsequent API requestsThe
toOpenAIMessage(),toEinoMessage(), and stream delta handling inchatmodel.gowere all dropping thereasoning_contentfield, causing multi-turn tool-calling conversations with DeepSeek reasoning models to fail.Fix
Map
ReasoningContentin all three message conversion points:toOpenAIMessage()— Eino Message → OpenAI request message (sends reasoning_content back to API)toEinoMessage()— OpenAI response → Eino Message (captures reasoning_content from non-streaming responses)Both
go-openaiv1.41.2 and Eino v0.8.11 already support theReasoningContentfield — only the conversion layer was missing the mapping.