Skip to content

fix: update Deepseek configurations - #1083

Merged
taltas merged 5 commits into
Zoo-Code-Org:mainfrom
WHMHammer:pr-upstream
Aug 3, 2026
Merged

fix: update Deepseek configurations#1083
taltas merged 5 commits into
Zoo-Code-Org:mainfrom
WHMHammer:pr-upstream

Conversation

@WHMHammer

@WHMHammer WHMHammer commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #1082

Description

Fixed the misalignments between the current Zoo Code Deepseek configurations and the official documentation. Check @1082 for more details.

Test Procedure

Built the extension locally and verified that it's working on my system.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Visual Snapshot (UI changes only): If a user would notice this change at a glance (layout, theme tokens, brand elements, empty/error states), I've added or updated a *.visual.tsx snapshot in webview-ui/. See webview-ui/AGENTS.md → "When a UI change needs a snapshot".
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Visual Snapshots

N/A

Videos (interaction / animation only)

N/A

Documentation Updates

N/A

Additional Notes

N/A

Get in Touch

I don't use Discord. Please comment in this PR or the linked issue. I signed up for email notifications and will respond promptly.

Summary by CodeRabbit

  • Updates
    • Updated DeepSeek V4 Flash and Pro model details, including pricing, context limits, image support, and reasoning options.
    • Added reasoning controls for disabling reasoning and selecting higher effort levels.
    • Improved thinking-mode behavior for V4 models and explicit reasoning settings.
    • Removed legacy DeepSeek Chat and Reasoner model entries.
    • Adjusted the default DeepSeek temperature setting from 0.3 to 0.0.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

DeepSeek V4 Flash and Pro metadata now use revised reasoning options and pricing. Retired model IDs were removed. Model-specific thinking behavior and tests now target V4 models. The default temperature changed from 0.3 to 0.0.

Changes

DeepSeek V4 support

Layer / File(s) Summary
Update DeepSeek model configuration
packages/types/src/providers/deepseek.ts
V4 Flash and Pro use updated reasoning options and zero input pricing. Legacy model entries were removed. The default temperature is now 0.0.
Align V4 thinking behavior
src/api/providers/deepseek.ts, src/api/providers/__tests__/deepseek.spec.ts
Thinking activation and reasoning-effort normalization now use model-specific V4 rules. Tests cover V4 Flash metadata and V4 Pro reasoning, streaming, thinking-parameter, and tool-call behavior.
Update model integration fixtures
src/core/config/__tests__/importExport.spec.ts, src/core/webview/__tests__/webviewMessageHandler.routerModels.spec.ts
Configuration and router-model tests now use V4 model IDs and updated context metadata.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Request as DeepSeek request builder
  participant Normalizer as reasoning-effort normalizer
  participant API as DeepSeek V4 API
  Request->>Normalizer: pass model ID and reasoning effort
  Normalizer->>Normalizer: apply Flash or Pro mapping
  Normalizer->>API: send normalized thinking parameters
Loading

Possibly related PRs

Suggested reviewers: edelauna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the DeepSeek configuration update, which matches the primary changes in the pull request.
Description check ✅ Passed The description includes the linked issue, implementation summary, test procedure, checklist, and documentation status.
Linked Issues check ✅ Passed The changes satisfy issue #1082 by updating reasoning mappings, pricing, model IDs, and the default temperature.
Out of Scope Changes check ✅ Passed All code and test changes support the DeepSeek configuration updates required by issue #1082.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/types/src/providers/deepseek.ts`:
- Line 27: Update DeepSeekHandler.getModel() to map deepseek-chat and
deepseek-reasoner to deepseek-v4-flash before model lookup and before
constructing requestOptions.model, while preserving the legacy thinking behavior
associated with each retired ID.
- Line 17: Update the DeepSeek V4 model metadata in DeepSeekHandler so
non-thinking mode remains discoverable: add "disable" to both
supportsReasoningEffort arrays, or consistently introduce and use a separate
supportsReasoningBinary capability while preserving the existing thinking.type:
"disabled" behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8d15a12-9b4d-4fe0-96da-18c097797209

📥 Commits

Reviewing files that changed from the base of the PR and between ca9b60f and 8d68939.

📒 Files selected for processing (1)
  • packages/types/src/providers/deepseek.ts

Comment thread packages/types/src/providers/deepseek.ts Outdated
Comment thread packages/types/src/providers/deepseek.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/api/providers/__tests__/deepseek.spec.ts (2)

248-248: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Replace removed legacy tests with migration tests.

These deletions remove coverage for deepseek-reasoner thinking behavior and deepseek-chat non-thinking behavior. New V4 tests do not verify existing profiles that still contain retired IDs. Add tests for the migrated request model and its thinking value for both aliases. (raw.githubusercontent.com)

Also applies to: 617-620

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api/providers/__tests__/deepseek.spec.ts` at line 248, Add migration
coverage in the DeepSeek provider tests for both aliases: verify the migrated
request model and its expected thinking value for deepseek-reasoner and
deepseek-chat, including the existing profiles that reference retired IDs.
Replace the removed legacy-test coverage without changing unrelated
default-model behavior.

Source: Coding guidelines


229-229: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the complete reasoning contract.

toContain("max") does not prove that retired options are absent. The removed test also leaves no coverage for Flash xhigh → high, Pro low → high, or Pro xhigh → max. Assert the exact option arrays and add request-construction cases for these mappings and disable. This follows the package-local unit-test guideline. (raw.githubusercontent.com)

Also applies to: 583-583

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api/providers/__tests__/deepseek.spec.ts` at line 229, Update the
reasoning-effort assertions in the DeepSeek provider tests to compare complete
option arrays, ensuring retired options are absent. Extend request-construction
coverage for Flash xhigh→high, Pro low→high, Pro xhigh→max, and disable
mappings, using the existing test helpers and model symbols around the affected
cases.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/api/providers/deepseek.ts`:
- Line 40: Update the reasoning-effort normalization flow around
supportsDeepSeekThinkingToggle and the downstream normalizer so it receives
modelId or equivalent model metadata. Apply model-specific mappings: Flash
preserves low and converts xhigh to high; Pro converts low to high and xhigh to
max. Ensure the output type continues to include low.

---

Nitpick comments:
In `@src/api/providers/__tests__/deepseek.spec.ts`:
- Line 248: Add migration coverage in the DeepSeek provider tests for both
aliases: verify the migrated request model and its expected thinking value for
deepseek-reasoner and deepseek-chat, including the existing profiles that
reference retired IDs. Replace the removed legacy-test coverage without changing
unrelated default-model behavior.
- Line 229: Update the reasoning-effort assertions in the DeepSeek provider
tests to compare complete option arrays, ensuring retired options are absent.
Extend request-construction coverage for Flash xhigh→high, Pro low→high, Pro
xhigh→max, and disable mappings, using the existing test helpers and model
symbols around the affected cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 706a6d21-9119-4137-aee4-44f35d267201

📥 Commits

Reviewing files that changed from the base of the PR and between 8d68939 and eef297f.

📒 Files selected for processing (5)
  • packages/types/src/providers/deepseek.ts
  • src/api/providers/__tests__/deepseek.spec.ts
  • src/api/providers/deepseek.ts
  • src/core/config/__tests__/importExport.spec.ts
  • src/core/webview/__tests__/webviewMessageHandler.routerModels.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/types/src/providers/deepseek.ts

Comment thread src/api/providers/deepseek.ts
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/providers/deepseek.ts 94.44% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@WHMHammer

Copy link
Copy Markdown
Contributor Author

All discussions started by the bot are resolved. This is the first time I submit a PR to a project set up with an AI pipeline. I am truly impressed!

Thank you for your great work of maintaining Zoo Code!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 31, 2026

// https://api-docs.deepseek.com/quick_start/parameter_settings
export const DEEP_SEEK_DEFAULT_TEMPERATURE = 0.3
export const DEEP_SEEK_DEFAULT_TEMPERATURE = 0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about setting this to 0 completely. I know their docs say 0 for coding, but I think you still need a bit of variance there for 'creativity', 0.3 felt right to me.

@WHMHammer WHMHammer Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove this change if you insist. But according to https://api-docs.deepseek.com/guides/thinking_mode:

Thinking mode does not support the temperature, top_p, presence_penalty, or frequency_penalty parameters.

So it's only going to affect the case when the reasoning effor is set to "disable" anyway. Besides, this is just the default value. The users can always adjust the actual temperature in the extension.

@github-actions github-actions Bot added awaiting-author PR is waiting for the author to address requested changes and removed awaiting-review PR changes are ready and waiting for maintainer re-review labels Aug 1, 2026
@taltas

taltas commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

normalizeDeepSeekReasoningEffort needs to be model-aware.

Right now it maps every value except xhigh to high, so Flash low and both models’ max selections are not sent as selected.

Zoo Code supports a broad shared set of reasoning values, while each DeepSeek model accepts a smaller set. The normalizer should preserve supported values and only translate old or unsupported ones:

  • Flash: preserve low, high, and max; map medium/xhigh to high.
  • Pro: preserve high and max; map low/medium to high and xhigh to max.
  • disable should continue disabling thinking and omitting reasoning_effort.

Suggested change: pass modelId into the normalizer, widen the request type to include low, and add table-driven tests for these outgoing mappings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/api/providers/deepseek.ts (1)

36-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Removing the deepseek-reasoner alias check makes the thinking ternary's fallback branch dead code.

After this change, isDeepSeekThinkingEnabled returns exactly supportsDeepSeekThinkingToggle(modelId) once the explicit-disable checks are cleared. This means isThinkingModel can only be true when supportsDeepSeekThinkingToggle(modelId) is also true.

Downstream, at Lines 133-137, the thinking computation is:

const thinking = supportsDeepSeekThinkingToggle(modelId)
	? ({ type: isThinkingModel ? "enabled" : "disabled" } as const)
	: isThinkingModel
		? ({ type: "enabled" } as const)
		: undefined

The : isThinkingModel ? ({ type: "enabled" } as const) : undefined branch can never select { type: "enabled" }, because reaching it requires supportsDeepSeekThinkingToggle(modelId) to be false, which forces isThinkingModel to also be false. This branch is now unreachable dead code. Simplify it to reduce confusion for future maintainers.

♻️ Proposed simplification
-		const thinking = supportsDeepSeekThinkingToggle(modelId)
-			? ({ type: isThinkingModel ? "enabled" : "disabled" } as const)
-			: isThinkingModel
-				? ({ type: "enabled" } as const)
-				: undefined
+		const thinking = supportsDeepSeekThinkingToggle(modelId)
+			? ({ type: isThinkingModel ? "enabled" : "disabled" } as const)
+			: undefined
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api/providers/deepseek.ts` around lines 36 - 42, In the thinking
computation inside the DeepSeek provider, simplify the fallback branch because
isThinkingModel cannot be true when supportsDeepSeekThinkingToggle(modelId) is
false. Preserve the enabled/disabled object selection when the toggle is
supported, and return undefined directly for the unsupported-toggle case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/api/providers/deepseek.ts`:
- Around line 44-84: Update normalizeDeepSeekReasoningEffort to handle
reasoningEffort === "medium" in both model-specific switches: return "high" for
deepseek-v4-flash and deepseek-v4-pro, while preserving all existing mappings
and the undefined fallback for unsupported values.

---

Nitpick comments:
In `@src/api/providers/deepseek.ts`:
- Around line 36-42: In the thinking computation inside the DeepSeek provider,
simplify the fallback branch because isThinkingModel cannot be true when
supportsDeepSeekThinkingToggle(modelId) is false. Preserve the enabled/disabled
object selection when the toggle is supported, and return undefined directly for
the unsupported-toggle case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 958909da-1d1e-4aa6-9df1-1c1f61eaba4f

📥 Commits

Reviewing files that changed from the base of the PR and between b6ed94c and ba1d5f0.

📒 Files selected for processing (5)
  • packages/types/src/providers/deepseek.ts
  • src/api/providers/__tests__/deepseek.spec.ts
  • src/api/providers/deepseek.ts
  • src/core/config/__tests__/importExport.spec.ts
  • src/core/webview/__tests__/webviewMessageHandler.routerModels.spec.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/core/config/tests/importExport.spec.ts
  • src/core/webview/tests/webviewMessageHandler.routerModels.spec.ts
  • src/api/providers/tests/deepseek.spec.ts
  • packages/types/src/providers/deepseek.ts

Comment thread src/api/providers/deepseek.ts
@WHMHammer

Copy link
Copy Markdown
Contributor Author

normalizeDeepSeekReasoningEffort needs to be model-aware.

Right now it maps every value except xhigh to high, so Flash low and both models’ max selections are not sent as selected.

Zoo Code supports a broad shared set of reasoning values, while each DeepSeek model accepts a smaller set. The normalizer should preserve supported values and only translate old or unsupported ones:

* Flash: preserve `low`, `high`, and `max`; map `medium`/`xhigh` to `high`.

* Pro: preserve `high` and `max`; map `low`/`medium` to `high` and `xhigh` to `max`.

* `disable` should continue disabling thinking and omitting `reasoning_effort`.

Suggested change: pass modelId into the normalizer, widen the request type to include low, and add table-driven tests for these outgoing mappings.

I just added the fix in a new commit and unit testing in another.

@taltas taltas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback. I'm approving the PR.

@taltas
taltas added this pull request to the merge queue Aug 3, 2026
Merged via the queue into Zoo-Code-Org:main with commit a9cf1d3 Aug 3, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author PR is waiting for the author to address requested changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Deepseek configs are not up to date

2 participants