mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-04 05:00:00 +08:00
### What this PR does Before this PR: - `@ai-sdk/deepseek` was pinned to `2.0.29`, missing an upstream fix for `deepseek-v4` reasoning content in multi-turn conversations. After this PR: - Bumps `@ai-sdk/deepseek` from `2.0.29` to `2.0.30` (latest stable). - Renames the local patch file to `@ai-sdk__deepseek@2.0.30.patch` and updates the `pnpm.patchedDependencies` key. The patch (which adds the `reasoning_effort` option for `high`/`max`) re-applies cleanly because the patched regions are unchanged in `2.0.30`. Fixes # ### Why we need it and why it was done in this way Upstream `2.0.30` ships a single fix from vercel/ai commit `0498012`: `fix(provider/deepseek): preserve reasoning_content for deepseek-v4 in multi-turn requests`. It threads the `modelId` into `convertToDeepSeekChatMessages`, stops dropping `reasoning` blocks before the last user message for `deepseek-v4`, and ensures `reasoning_content` is at least `""` rather than `undefined` so the field is preserved across turns. Keeping the local patch in sync with upstream prevents drift and unblocks future DeepSeek model rollouts. The following tradeoffs were made: - Patch file content is byte-identical; only the filename and `pnpm.patchedDependencies` key are updated. This avoids gratuitous diff churn while keeping the patch addressable to the new version. The following alternatives were considered: - Wait for a larger DeepSeek change before bumping — rejected; the upstream fix is small, isolated, and there is no reason to delay. - Move to `3.0.0-beta.x` — rejected; betas track AI SDK v6 and are out of scope for the `main` branch hotfix lane. Links to places where the discussion took place: N/A ### Breaking changes None. Public API surface, exported types, and the `reasoning_effort` patch behavior are unchanged. ### Special notes for your reviewer - Verified the patch applied to `2.0.30` in `node_modules` — both the local addition (`reasoning_effort`) and the upstream fix (`isDeepSeekV4`) are present after `pnpm install`. - `pnpm build:check` passes locally (4199 tests, 0 errors). - This change is restricted to `main` per the code-freeze policy and is delivered from a `hotfix/*` branch with no refactoring. ### Checklist - [x] PR: The PR description is expressive enough and will help future contributors - [x] Code: Write code that humans can understand and Keep it simple - [x] Refactor: You have left the code cleaner than you found it (Boy Scout Rule) - [x] Upgrade: Impact of this change on upgrade flows was considered and addressed if required - [ ] Documentation: A user-guide update was considered and is present (link) or not required. Check this only when the PR introduces or changes a user-facing feature or behavior. - [x] Self-review: I have reviewed my own code before requesting review from others ### Release note ```release-note NONE ``` --------- Signed-off-by: suyao <sy20010504@gmail.com>
55 lines
2.2 KiB
Diff
55 lines
2.2 KiB
Diff
diff --git a/dist/index.js b/dist/index.js
|
|
index 243aa9c186c2b647bfd307984e3a8ad8d2f00086..14406ffff6acb8a3d38eb338d20da069eee1875a 100644
|
|
--- a/dist/index.js
|
|
+++ b/dist/index.js
|
|
@@ -303,7 +303,11 @@ var deepseekLanguageModelOptions = import_v42.z.object({
|
|
*/
|
|
thinking: import_v42.z.object({
|
|
type: import_v42.z.enum(["enabled", "disabled"]).optional()
|
|
- }).optional()
|
|
+ }).optional(),
|
|
+ /**
|
|
+ * Reasoning effort for DeepSeek V4+ models. Accepts `"high"` or `"max"`.
|
|
+ */
|
|
+ reasoning_effort: import_v42.z.enum(["high", "max"]).optional()
|
|
});
|
|
|
|
// src/chat/deepseek-prepare-tools.ts
|
|
@@ -470,7 +474,8 @@ var DeepSeekChatLanguageModel = class {
|
|
messages,
|
|
tools: deepseekTools,
|
|
tool_choice: deepseekToolChoices,
|
|
- thinking: ((_b = deepseekOptions.thinking) == null ? void 0 : _b.type) != null ? { type: deepseekOptions.thinking.type } : void 0
|
|
+ thinking: ((_b = deepseekOptions.thinking) == null ? void 0 : _b.type) != null ? { type: deepseekOptions.thinking.type } : void 0,
|
|
+ reasoning_effort: deepseekOptions.reasoning_effort
|
|
},
|
|
warnings: [...warnings, ...toolWarnings]
|
|
};
|
|
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
index 6a2d2d14739e3b50faa398ff94092bd5b0ea874d..947eb026b4eecd256c1009be364b35aaa3c2e628 100644
|
|
--- a/dist/index.mjs
|
|
+++ b/dist/index.mjs
|
|
@@ -292,7 +292,11 @@ var deepseekLanguageModelOptions = z2.object({
|
|
*/
|
|
thinking: z2.object({
|
|
type: z2.enum(["enabled", "disabled"]).optional()
|
|
- }).optional()
|
|
+ }).optional(),
|
|
+ /**
|
|
+ * Reasoning effort for DeepSeek V4+ models. Accepts `"high"` or `"max"`.
|
|
+ */
|
|
+ reasoning_effort: z2.enum(["high", "max"]).optional()
|
|
});
|
|
|
|
// src/chat/deepseek-prepare-tools.ts
|
|
@@ -459,7 +463,8 @@ var DeepSeekChatLanguageModel = class {
|
|
messages,
|
|
tools: deepseekTools,
|
|
tool_choice: deepseekToolChoices,
|
|
- thinking: ((_b = deepseekOptions.thinking) == null ? void 0 : _b.type) != null ? { type: deepseekOptions.thinking.type } : void 0
|
|
+ thinking: ((_b = deepseekOptions.thinking) == null ? void 0 : _b.type) != null ? { type: deepseekOptions.thinking.type } : void 0,
|
|
+ reasoning_effort: deepseekOptions.reasoning_effort
|
|
},
|
|
warnings: [...warnings, ...toolWarnings]
|
|
};
|