Skip to content

feat: add DeepSeek V4 model support and fix thinking mode detection#12176

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/deepseek-v4-support
Draft

feat: add DeepSeek V4 model support and fix thinking mode detection#12176
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/deepseek-v4-support

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 Bot commented Apr 24, 2026

This PR attempts to address Issue #12174. Feedback and guidance are welcome.

Changes

1. Add DeepSeek V4 model (deepseek-v4-0324)

2. Fix thinking mode detection (root cause of the 400 error)

  • Changed src/api/providers/deepseek.ts to detect thinking mode via the preserveReasoning flag on ModelInfo instead of hardcoding modelId.includes("deepseek-reasoner")
  • This means any model with preserveReasoning: true automatically gets thinking mode enabled, including v4 and any future models
  • This fixes the reported 400 error ("The reasoning_content in the thinking mode must be passed back to the API") for v4 models

3. Tests

  • Added model info tests for deepseek-v4-0324
  • Added thinking mode behavior tests for v4 model
  • Updated mock to recognize v4 models as reasoning models
  • All 27 tests pass

Notes

  • The pricing values for v4 may need verification against the latest DeepSeek API docs
  • If additional v4 model variants exist (e.g. flash), they can be added following the same pattern

Interactively review PR in Roo Code Cloud

- Add deepseek-v4-0324 model to the DeepSeek provider model list with
  thinking mode, vision support, and pricing info
- Fix thinking mode detection to use preserveReasoning flag from ModelInfo
  instead of hardcoding model name check for "deepseek-reasoner"
- This allows any model with preserveReasoning=true to automatically get
  thinking mode enabled, including v4 and future models
- Add tests for v4 model info and thinking mode behavior

Addresses #12174
@designgears
Copy link
Copy Markdown

model names should be
deepseek-v4-pro
deepseek-v4-flash

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.

2 participants