From 7ce8ff1b9f4cd11604b82c8edb78d08216e8024d Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 3 Dec 2025 17:24:17 +0000 Subject: [PATCH] fix: remove non-existent DeepSeek model aliases per API docs - Remove deepseek-v3 and deepseek-3.2-exp from DeepSeek Direct API (only deepseek-chat and deepseek-reasoner are supported) - Keep deepseek-3.2 as version alias for deepseek-chat - Remove deepseek/deepseek-v3 test from OpenRouter (only deepseek/deepseek-v3.2 exists) - Update documentation references to API docs --- packages/types/src/providers/deepseek.ts | 17 +++----- src/api/providers/__tests__/deepseek.spec.ts | 32 -------------- .../providers/__tests__/openrouter.spec.ts | 42 +------------------ 3 files changed, 6 insertions(+), 85 deletions(-) diff --git a/packages/types/src/providers/deepseek.ts b/packages/types/src/providers/deepseek.ts index f35f45bc0c..b9082c8541 100644 --- a/packages/types/src/providers/deepseek.ts +++ b/packages/types/src/providers/deepseek.ts @@ -22,19 +22,13 @@ const deepSeekV3Info: ModelInfo = { export const deepSeekModels = { "deepseek-chat": deepSeekV3Info, - // Aliases for DeepSeek V3 - these all map to deepseek-chat when calling the API - "deepseek-v3": { - ...deepSeekV3Info, - description: `DeepSeek-V3 (alias for deepseek-chat). ${deepSeekV3Info.description}`, - }, + // deepseek-3.2 is an alias for deepseek-chat (V3.2 is the current version) + // Note: The DeepSeek API only supports "deepseek-chat" and "deepseek-reasoner" + // See: https://api-docs.deepseek.com/quick_start/pricing "deepseek-3.2": { ...deepSeekV3Info, description: `DeepSeek V3.2 (alias for deepseek-chat). ${deepSeekV3Info.description}`, }, - "deepseek-3.2-exp": { - ...deepSeekV3Info, - description: `DeepSeek V3.2 Experimental (alias for deepseek-chat). ${deepSeekV3Info.description}`, - }, "deepseek-reasoner": { maxTokens: 65536, // 64K max output for reasoning mode contextWindow: 128_000, @@ -50,11 +44,10 @@ export const deepSeekModels = { } as const satisfies Record // Map of model aliases to their official API model names -// The DeepSeek API uses specific model names, but users may use alternative names +// The DeepSeek API only supports "deepseek-chat" and "deepseek-reasoner" +// See: https://api-docs.deepseek.com/quick_start/pricing export const deepSeekModelAliases: Record = { - "deepseek-v3": "deepseek-chat", "deepseek-3.2": "deepseek-chat", - "deepseek-3.2-exp": "deepseek-chat", } export const DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6 diff --git a/src/api/providers/__tests__/deepseek.spec.ts b/src/api/providers/__tests__/deepseek.spec.ts index 8660588daf..9d53898b83 100644 --- a/src/api/providers/__tests__/deepseek.spec.ts +++ b/src/api/providers/__tests__/deepseek.spec.ts @@ -148,25 +148,6 @@ describe("DeepSeekHandler", () => { expect(OpenAI).toHaveBeenCalledWith(expect.objectContaining({ apiKey: mockOptions.deepSeekApiKey })) }) - it("should map deepseek-v3 alias to deepseek-chat for API calls", async () => { - vi.clearAllMocks() - const handlerWithV3 = new DeepSeekHandler({ - ...mockOptions, - apiModelId: "deepseek-v3", - }) - const stream = handlerWithV3.createMessage("test", []) - for await (const _chunk of stream) { - // consume stream - } - // Verify the API was called with deepseek-chat (not deepseek-v3) - expect(mockCreate).toHaveBeenCalledWith( - expect.objectContaining({ - model: "deepseek-chat", - }), - expect.anything(), - ) - }) - it("should map deepseek-3.2 alias to deepseek-chat for API calls", async () => { vi.clearAllMocks() const handlerWith32 = new DeepSeekHandler({ @@ -212,19 +193,6 @@ describe("DeepSeekHandler", () => { expect(model.info.supportsPromptCache).toBe(true) }) - it("should return correct model info for deepseek-v3 alias", () => { - const handlerWithV3 = new DeepSeekHandler({ - ...mockOptions, - apiModelId: "deepseek-v3", - }) - const model = handlerWithV3.getModel() - expect(model.id).toBe("deepseek-v3") // Returns user's model ID - expect(model.info).toBeDefined() - expect(model.info.maxTokens).toBe(8192) // Same as deepseek-chat - expect(model.info.contextWindow).toBe(128_000) - expect(model.info.supportsNativeTools).toBe(true) - }) - it("should return correct model info for deepseek-3.2 alias", () => { const handlerWith32 = new DeepSeekHandler({ ...mockOptions, diff --git a/src/api/providers/__tests__/openrouter.spec.ts b/src/api/providers/__tests__/openrouter.spec.ts index 1fa12b7673..304811a48c 100644 --- a/src/api/providers/__tests__/openrouter.spec.ts +++ b/src/api/providers/__tests__/openrouter.spec.ts @@ -340,47 +340,7 @@ describe("OpenRouterHandler", () => { }) describe("DeepSeek V3 Model Handling", () => { - it("should NOT use R1 format for DeepSeek V3 models", async () => { - const deepseekV3Handler = new OpenRouterHandler({ - ...mockOptions, - openRouterModelId: "deepseek/deepseek-v3", - }) - - const mockStream = { - [Symbol.asyncIterator]: async function* () { - yield { - choices: [{ delta: { content: "test" }, finish_reason: null }], - usage: null, - } - yield { - choices: [{ delta: {}, finish_reason: "stop" }], - usage: { prompt_tokens: 10, completion_tokens: 5 }, - } - }, - } - - const mockCreate = vitest.fn().mockResolvedValue(mockStream) - ;(OpenAI as any).prototype.chat = { - completions: { create: mockCreate }, - } as any - - const generator = deepseekV3Handler.createMessage("system prompt", []) - const chunks = [] - for await (const chunk of generator) { - chunks.push(chunk) - } - - // Verify that the messages were NOT converted to R1 format - expect(mockCreate).toHaveBeenCalledWith( - expect.objectContaining({ - messages: expect.arrayContaining([ - expect.objectContaining({ role: "system", content: expect.anything() }), - ]), - }), - undefined, - ) - }) - + // Note: OpenRouter only has deepseek/deepseek-v3.2, not deepseek/deepseek-v3 it("should NOT use R1 format for DeepSeek V3.2 models", async () => { const deepseek32Handler = new OpenRouterHandler({ ...mockOptions,