Skip to content

add deepseek-v4 models (in deepseek API proivider)#10418

Open
Jabca wants to merge 2 commits into
cline:mainfrom
Jabca:add-deepseek-v4
Open

add deepseek-v4 models (in deepseek API proivider)#10418
Jabca wants to merge 2 commits into
cline:mainfrom
Jabca:add-deepseek-v4

Conversation

@Jabca

@Jabca Jabca commented Apr 26, 2026

Copy link
Copy Markdown

Related Issue

Issue: #XXXX

Description

Added deepseek-v4 models for deepseek API provider.

Test Procedure

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • [x ] ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have reviewed contributor guidelines

Screenshots

Additional Notes

@changeset-bot

changeset-bot Bot commented Apr 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 809dcc4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps

greptile-apps Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds two new DeepSeek V4 model definitions (deepseek-v4-pro and deepseek-v4-flash) to the provider and changes the default DeepSeek model from deepseek-chat to deepseek-v4-pro. There are several functional issues that need to be addressed before this is ready to merge:

  • isDeepseekV4 is declared in deepseek.ts but never used, leaving the temperature: 0 spread and the addReasoningContent routing unchanged for V4 models — both of which appear to require updating given V4's built-in reasoning/thinking mode.
  • Changing the default model ID silently migrates existing users who haven't explicitly chosen a model to a very different model with reasoning enabled and different pricing.

Confidence Score: 2/5

Not 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.

Important Files Changed

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
Loading

Comments Outside Diff (1)

  1. src/core/api/providers/deepseek.ts, line 88-90 (link)

    P1 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.

    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

Comment thread src/core/api/providers/deepseek.ts Outdated
Comment thread src/shared/api.ts Outdated
Comment thread src/shared/api.ts
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 26, 2026
… 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
@Jabca Jabca changed the title added deepseek-v4 models add deepseek-v4 models (in deepseek API proivider) Apr 26, 2026
@Jabca

Jabca commented Apr 26, 2026

Copy link
Copy Markdown
Author

Greptile Summary

This PR adds two new DeepSeek V4 model definitions (deepseek-v4-pro and deepseek-v4-flash) to the provider and changes the default DeepSeek model from deepseek-chat to deepseek-v4-pro. There are several functional issues that need to be addressed before this is ready to merge:

  • isDeepseekV4 is declared in deepseek.ts but never used, leaving the temperature: 0 spread and the addReasoningContent routing unchanged for V4 models — both of which appear to require updating given V4's built-in reasoning/thinking mode.
  • Changing the default model ID silently migrates existing users who haven't explicitly chosen a model to a very different model with reasoning enabled and different pricing.

Confidence Score: 2/5

Not 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.

Important Files Changed

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
Loading

Comments Outside Diff (1)

  1. src/core/api/providers/deepseek.ts, line 88-90 (link)
    P1 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.
    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

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant