fix(aiService): improve deepseek-reasoner compatibility#75
Conversation
📝 WalkthroughWalkthroughThis PR fixes a compatibility issue with DeepSeek's Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/services/aiService.ts (1)
72-88: Add regression tests for request-body shape in this branch.Please add a focused test asserting that
temperatureandreasoningare omitted fordeepseek-reasoner, and still present for non-DeepSeek models. This will protect this compatibility fix from future regressions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/services/aiService.ts` around lines 72 - 88, Add focused unit tests for the request body shape produced by the code that builds requestBody in aiService.ts: call the method (or class) that constructs the request body (exercise isDeepSeekReasonerModel() via setting this.config.model or mocking it) for both apiType branches ('openai-responses' and others) and assert that when model is a deepseek-reasoner variant temperature and reasoning are omitted from the resulting request object, and that for a non-DeepSeek model both temperature and reasoning are present with the expected values; target the functions isDeepSeekReasonerModel() and the requestBody construction logic so the tests fail on regressions and mock options.temperature/options.maxTokens/reasoning as needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/services/aiService.ts`:
- Around line 72-88: Add focused unit tests for the request body shape produced
by the code that builds requestBody in aiService.ts: call the method (or class)
that constructs the request body (exercise isDeepSeekReasonerModel() via setting
this.config.model or mocking it) for both apiType branches ('openai-responses'
and others) and assert that when model is a deepseek-reasoner variant
temperature and reasoning are omitted from the resulting request object, and
that for a non-DeepSeek model both temperature and reasoning are present with
the expected values; target the functions isDeepSeekReasonerModel() and the
requestBody construction logic so the tests fail on regressions and mock
options.temperature/options.maxTokens/reasoning as needed.
|
This fix has been included in v0.3.0 release. The DeepSeek Reasoner compatibility issue has been resolved by removing unsupported Thank you for the contribution! 🦞 |
Closes
Fixes #70
Overview
This PR fixes compatibility issues when using DeepSeek's official
deepseek-reasonermodel through the OpenAI-compatible chat completions path.Changes
deepseek-reasonerspecifically in the OpenAI-compatible branchtemperaturefor that modelreasoningpayload for that modelWhy this is safe
This change is scoped only to
apiType === "openai"with model name exactlydeepseek-reasoner. It does not affect:openai-responsesValidation
npm run build