Skip to content

Commit 63e98d7

Browse files
committed
fix: remove deepseek-chat and deekseek-reasoner tests, or change them to deepseek-v4-flash or deepseek-v4-pro
1 parent e57ac92 commit 63e98d7

4 files changed

Lines changed: 17 additions & 99 deletions

File tree

src/api/providers/__tests__/deepseek.spec.ts

Lines changed: 12 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe("DeepSeekHandler", () => {
137137
beforeEach(() => {
138138
mockOptions = {
139139
deepSeekApiKey: "test-api-key",
140-
apiModelId: "deepseek-chat",
140+
apiModelId: "deepseek-v4-flash",
141141
deepSeekBaseUrl: "https://api.deepseek.com",
142142
}
143143
handler = new DeepSeekHandler(mockOptions)
@@ -208,11 +208,11 @@ describe("DeepSeekHandler", () => {
208208
const model = handler.getModel()
209209
expect(model.id).toBe(mockOptions.apiModelId)
210210
expect(model.info).toBeDefined()
211-
expect(model.info.maxTokens).toBe(8192) // deepseek-chat legacy alias has 8K max
212-
expect(model.info.contextWindow).toBe(128_000)
213-
expect(model.info.supportsImages).toBe(false)
211+
expect(model.info.maxTokens).toBe(384_000)
212+
expect(model.info.contextWindow).toBe(1_000_000)
213+
expect(model.info.supportsImages).toBe(true)
214214
expect(model.info.supportsPromptCache).toBe(true) // Should be true now
215-
expect((model.info as ModelInfo).preserveReasoning).toBeUndefined()
215+
expect((model.info as ModelInfo).preserveReasoning).toBe(true)
216216
})
217217

218218
it("should use deepseek-v4-flash as the default model ID for new configs", () => {
@@ -226,21 +226,7 @@ describe("DeepSeekHandler", () => {
226226
expect(model.info.maxTokens).toBe(384_000)
227227
expect(model.info.contextWindow).toBe(1_000_000)
228228
expect(model.info.supportsImages).toBe(true)
229-
expect((model.info as ModelInfo).supportsReasoningEffort).toContain("xhigh")
230-
})
231-
232-
it("should return correct model info for deepseek-reasoner", () => {
233-
const handlerWithReasoner = new DeepSeekHandler({
234-
...mockOptions,
235-
apiModelId: "deepseek-reasoner",
236-
})
237-
const model = handlerWithReasoner.getModel()
238-
expect(model.id).toBe("deepseek-reasoner")
239-
expect(model.info).toBeDefined()
240-
expect(model.info.maxTokens).toBe(8192) // deepseek-reasoner has 8K max
241-
expect(model.info.contextWindow).toBe(128_000)
242-
expect(model.info.supportsImages).toBe(false)
243-
expect(model.info.supportsPromptCache).toBe(true)
229+
expect((model.info as ModelInfo).supportsReasoningEffort).toContain("max")
244230
})
245231

246232
it("should return correct model info for deepseek-v4-pro", () => {
@@ -259,31 +245,6 @@ describe("DeepSeekHandler", () => {
259245
expect((model.info as ModelInfo).reasoningEffort).toBe("high")
260246
})
261247

262-
it("should have preserveReasoning enabled for deepseek-reasoner to support interleaved thinking", () => {
263-
// This is critical for DeepSeek's interleaved thinking mode with tool calls.
264-
// See: https://api-docs.deepseek.com/guides/thinking_mode
265-
// The reasoning_content needs to be passed back during tool call continuation
266-
// within the same turn for the model to continue reasoning properly.
267-
const handlerWithReasoner = new DeepSeekHandler({
268-
...mockOptions,
269-
apiModelId: "deepseek-reasoner",
270-
})
271-
const model = handlerWithReasoner.getModel()
272-
// Cast to ModelInfo to access preserveReasoning which is an optional property
273-
expect((model.info as ModelInfo).preserveReasoning).toBe(true)
274-
})
275-
276-
it("should NOT have preserveReasoning enabled for deepseek-chat", () => {
277-
// deepseek-chat doesn't use thinking mode, so no need to preserve reasoning
278-
const chatHandler = new DeepSeekHandler({
279-
...mockOptions,
280-
apiModelId: "deepseek-chat",
281-
})
282-
const model = chatHandler.getModel()
283-
// Cast to ModelInfo to access preserveReasoning which is an optional property
284-
expect((model.info as ModelInfo).preserveReasoning).toBeUndefined()
285-
})
286-
287248
it("should return provided model ID with default model info if model does not exist", () => {
288249
const handlerWithInvalidModel = new DeepSeekHandler({
289250
...mockOptions,
@@ -540,10 +501,10 @@ describe("DeepSeekHandler", () => {
540501
},
541502
]
542503

543-
it("should handle reasoning_content in streaming responses for deepseek-reasoner", async () => {
504+
it("should handle reasoning_content in streaming responses for deepseek-v4-pro", async () => {
544505
const reasonerHandler = new DeepSeekHandler({
545506
...mockOptions,
546-
apiModelId: "deepseek-reasoner",
507+
apiModelId: "deepseek-v4-pro",
547508
})
548509

549510
const stream = reasonerHandler.createMessage(systemPrompt, messages)
@@ -559,10 +520,10 @@ describe("DeepSeekHandler", () => {
559520
expect(reasoningChunks[1].text).toBe(" I'll analyze step by step.")
560521
})
561522

562-
it("should pass thinking parameter for deepseek-reasoner model", async () => {
523+
it("should pass thinking parameter for deepseek-v4-pro model", async () => {
563524
const reasonerHandler = new DeepSeekHandler({
564525
...mockOptions,
565-
apiModelId: "deepseek-reasoner",
526+
apiModelId: "deepseek-v4-pro",
566527
})
567528

568529
const stream = reasonerHandler.createMessage(systemPrompt, messages)
@@ -579,7 +540,7 @@ describe("DeepSeekHandler", () => {
579540
{}, // Empty path options for non-Azure URLs
580541
)
581542
const callArgs = mockCreate.mock.calls[0][0]
582-
expect(callArgs.reasoning_effort).toBeUndefined()
543+
expect(callArgs.reasoning_effort).toBe("high")
583544
})
584545

585546
it("should enable thinking by default for deepseek-v4-flash", async () => {
@@ -619,27 +580,6 @@ describe("DeepSeekHandler", () => {
619580
expect(callArgs.max_completion_tokens).toBe(32_000)
620581
})
621582

622-
it("should map xhigh reasoning effort to DeepSeek max effort", async () => {
623-
const v4Handler = new DeepSeekHandler({
624-
...mockOptions,
625-
apiModelId: "deepseek-v4-pro",
626-
reasoningEffort: "xhigh",
627-
})
628-
629-
const stream = v4Handler.createMessage(systemPrompt, messages)
630-
for await (const _chunk of stream) {
631-
// Consume the stream
632-
}
633-
634-
expect(mockCreate).toHaveBeenCalledWith(
635-
expect.objectContaining({
636-
thinking: { type: "enabled" },
637-
reasoning_effort: "max",
638-
}),
639-
{},
640-
)
641-
})
642-
643583
it("should disable thinking for deepseek-v4 models when reasoning is disabled", async () => {
644584
const v4Handler = new DeepSeekHandler({
645585
...mockOptions,
@@ -674,26 +614,10 @@ describe("DeepSeekHandler", () => {
674614
expect(callArgs.temperature).toBe(DEEP_SEEK_DEFAULT_TEMPERATURE)
675615
})
676616

677-
it("should NOT pass thinking parameter for deepseek-chat model", async () => {
678-
const chatHandler = new DeepSeekHandler({
679-
...mockOptions,
680-
apiModelId: "deepseek-chat",
681-
})
682-
683-
const stream = chatHandler.createMessage(systemPrompt, messages)
684-
for await (const _chunk of stream) {
685-
// Consume the stream
686-
}
687-
688-
// Verify that the thinking parameter was NOT passed to the API
689-
const callArgs = mockCreate.mock.calls[0][0]
690-
expect(callArgs.thinking).toBeUndefined()
691-
})
692-
693617
it("should handle tool calls with reasoning_content", async () => {
694618
const reasonerHandler = new DeepSeekHandler({
695619
...mockOptions,
696-
apiModelId: "deepseek-reasoner",
620+
apiModelId: "deepseek-v4-pro",
697621
})
698622

699623
const tools: any[] = [

src/api/providers/deepseek.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const isDeepSeekThinkingEnabled = (modelId: string, options: ApiHandlerOptions)
3737
return false
3838
}
3939

40-
return modelId === "deepseek-reasoner" || supportsDeepSeekThinkingToggle(modelId)
40+
return supportsDeepSeekThinkingToggle(modelId)
4141
}
4242

4343
const normalizeDeepSeekReasoningEffort = (reasoningEffort?: string): "high" | "max" | undefined => {

src/core/config/__tests__/importExport.spec.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,21 +2510,15 @@ describe("importExport", () => {
25102510
{
25112511
testCase: "supportsReasoningBudget is false",
25122512
providerName: "deepseek-provider",
2513-
modelId: "deepseek-chat",
2513+
modelId: "deepseek-v4-flash",
25142514
providerId: "deepseek-id",
25152515
},
25162516
{
25172517
testCase: "requiredReasoningBudget is false",
25182518
providerName: "deepseek-provider-2",
2519-
modelId: "deepseek-coder",
2519+
modelId: "deepseek-v4-pro",
25202520
providerId: "deepseek-id-2",
25212521
},
2522-
{
2523-
testCase: "both supportsReasoningBudget and requiredReasoningBudget are false",
2524-
providerName: "deepseek-provider-3",
2525-
modelId: "deepseek-reasoner",
2526-
providerId: "deepseek-id-3",
2527-
},
25282522
])(
25292523
"should exclude modelMaxTokens and modelMaxThinkingTokens when $testCase",
25302524
async ({ providerName, modelId, providerId }) => {

src/core/webview/__tests__/webviewMessageHandler.routerModels.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("webviewMessageHandler - requestRouterModels provider filter", () => {
128128

129129
getModelsMock.mockImplementation(async (options: any) => {
130130
if (options?.provider === "deepseek") {
131-
return { "deepseek-chat": { contextWindow: 128000, supportsPromptCache: true } }
131+
return { "deepseek-v4-flash": { contextWindow: 1_000_000, supportsPromptCache: true } }
132132
}
133133

134134
switch (options?.provider) {
@@ -163,7 +163,7 @@ describe("webviewMessageHandler - requestRouterModels provider filter", () => {
163163
)
164164
expect(call).toBeTruthy()
165165
expect(call[0].routerModels.deepseek).toEqual({
166-
"deepseek-chat": { contextWindow: 128000, supportsPromptCache: true },
166+
"deepseek-v4-flash": { contextWindow: 1_000_000, supportsPromptCache: true },
167167
})
168168
})
169169

0 commit comments

Comments
 (0)