add deepseek-v4 models (in deepseek API proivider)#10418
Conversation
|
Greptile SummaryThis PR adds two new DeepSeek V4 model definitions (
Confidence Score: 2/5Not safe to merge — multiple P1 logic issues affect runtime behavior for both new and existing users. Three P1 findings: an unused variable that leaves V4 temperature handling broken, a missing addReasoningContent routing update for reasoning-capable V4 models, and a silent breaking change to the default model for all existing users without an explicit model selection. Both changed files need attention: deepseek.ts for the unused variable and missing routing logic, and api.ts for the default model change and promotional pricing.
|
| Filename | Overview |
|---|---|
| src/core/api/providers/deepseek.ts | Adds isDeepseekV4 variable but never uses it; the temperature exclusion condition and addReasoningContent routing are not updated to account for V4 models. |
| src/shared/api.ts | Adds deepseek-v4-pro and deepseek-v4-flash model definitions; changes the default model from deepseek-chat to deepseek-v4-pro, which is a silent breaking change for existing users. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[createMessage called] --> B{model.id includes 'deepseek-reasoner'?}
B -- yes --> C[openAiMessages with addReasoningContent]
B -- no --> D[openAiMessages without addReasoningContent]
D --> E[deepseek-v4-pro / deepseek-v4-flash land here]
C --> F{model.id === 'deepseek-reasoner'?}
D --> F
F -- yes --> G[no temperature param]
F -- no --> H[temperature: 0 applied]
H --> I[deepseek-v4-pro / deepseek-v4-flash get temperature:0 ⚠️ isDeepseekV4 never consulted]
G --> J[API call]
I --> J
Comments Outside Diff (1)
-
src/core/api/providers/deepseek.ts, line 88-90 (link)V4 reasoning models skip
addReasoningContenttransformThe new V4 models have
supportsReasoning: true, but theopenAiMessagesconstruction only callsaddReasoningContentforisDeepseekReasoner(model ID contains"deepseek-reasoner"). If DeepSeek V4's thinking mode producesreasoning_contentfields in the same way, the input message history will not be properly converted, potentially causing API errors or dropped reasoning context on subsequent turns.Prompt To Fix With AI
This is a comment left during a code review. Path: src/core/api/providers/deepseek.ts Line: 88-90 Comment: **V4 reasoning models skip `addReasoningContent` transform** The new V4 models have `supportsReasoning: true`, but the `openAiMessages` construction only calls `addReasoningContent` for `isDeepseekReasoner` (model ID contains `"deepseek-reasoner"`). If DeepSeek V4's thinking mode produces `reasoning_content` fields in the same way, the input message history will not be properly converted, potentially causing API errors or dropped reasoning context on subsequent turns. How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/core/api/providers/deepseek.ts
Line: 85-99
Comment:
**`isDeepseekV4` declared but never used**
`isDeepseekV4` is defined on line 85 but is never referenced anywhere in the function. The comment on line 98 says "V4 models have thinking on by default," strongly suggesting the intent was to exclude V4 models from the `temperature: 0` spread — just as `deepseek-reasoner` is excluded — but the condition was not updated. As written, V4 models still receive `temperature: 0`, which may conflict with their built-in reasoning/thinking mode.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/shared/api.ts
Line: 2102
Comment:
**Breaking default model change for existing users**
Changing `deepSeekDefaultModelId` from `"deepseek-chat"` to `"deepseek-v4-pro"` silently migrates any user who has not explicitly stored a model selection to the new model. The V4-pro model has `supportsReasoning: true`, a 1M-token context window, and different pricing — a significant behavioral and cost change that users won't be warned about.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/core/api/providers/deepseek.ts
Line: 88-90
Comment:
**V4 reasoning models skip `addReasoningContent` transform**
The new V4 models have `supportsReasoning: true`, but the `openAiMessages` construction only calls `addReasoningContent` for `isDeepseekReasoner` (model ID contains `"deepseek-reasoner"`). If DeepSeek V4's thinking mode produces `reasoning_content` fields in the same way, the input message history will not be properly converted, potentially causing API errors or dropped reasoning context on subsequent turns.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/shared/api.ts
Line: 2104-2114
Comment:
**Hardcoded discounted prices may confuse users**
The `outputPrice`, `cacheWritesPrice`, and `cacheReadsPrice` values for `deepseek-v4-pro` are described as "limited-time 75% off" promotional prices. When the promotion ends, Cline will silently under-bill users. Consider defaulting to the regular prices (with a comment noting the current discount) so cost calculations remain accurate after the promo ends.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "added deepseek-v4 models" | Re-trigger Greptile
… model entries, goose cargo-minor-and-patch grouped bump - QwenLM/qwen-code#3643 merge-after-nits: 2143-line manual Catalan translation, key-coverage diff + ICU-pluralization spot-check needed - cline/cline#10418 request-changes: dead isDeepseekV4 flag + silent default-model flip + inputPrice:0 cost-tracking footgun - aaif-goose/goose#8821 merge-after-nits: 24-package grouped dependabot bump touching axum/zip/rayon, CI-green + zip-changelog scan needed
fixed |
Related Issue
Issue: #XXXX
Description
Added deepseek-v4 models for deepseek API provider.
Test Procedure
Type of Change
Pre-flight Checklist
npm test) and code is formatted and linted (npm run format && npm run lint)Screenshots
Additional Notes