fix(sse): declare deepseek 1M default context window (#13922)

This commit is contained in:
diegosouzapw
2026-09-17 17:56:06 -03:00
parent 1deb77a00d
commit 6748798ecb
3 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1 @@
- fix(sse): deepseek provider registry now declares `defaultContextLength: 1_000_000` and an explicit `deepseek-flash` model entry, so unlisted/new DeepSeek models (like the new DeepSeek V4.1 Flash) no longer fall back to the generic 128k context limit (#13922)

View File

@@ -7,6 +7,7 @@ export const deepseekProvider: RegistryEntry = {
executor: "default",
baseUrl: "https://api.deepseek.com/responses",
authType: "apikey",
defaultContextLength: 1_000_000,
authHeader: "bearer",
alternateFormats: [
{
@@ -36,5 +37,14 @@ export const deepseekProvider: RegistryEntry = {
supportedThinkingEfforts: ["none", "low", "high", "max"],
toolCalling: true,
},
{
id: "deepseek-flash",
name: "DeepSeek V4.1 Flash",
contextLength: 1_000_000,
maxOutputTokens: 384_000,
supportsReasoning: true,
supportedThinkingEfforts: ["none", "low", "high", "max"],
toolCalling: true,
},
],
};

View File

@@ -0,0 +1,15 @@
import test from "node:test";
import assert from "node:assert/strict";
const { resolveTokenLimit } = await import("../../open-sse/services/contextManager.ts");
test("#13922: deepseek-flash (new 1M model, no registry/synced metadata) resolves to DeepSeek's 1M window", () => {
const resolved = resolveTokenLimit("deepseek", "deepseek-flash");
assert.equal(resolved.limit, 1_000_000);
assert.equal(resolved.specific, true);
});
test("#13922: any unlisted deepseek model id inherits the provider's 1M defaultContextLength", () => {
const resolved = resolveTokenLimit("deepseek", "deepseek-some-future-model-not-yet-in-registry");
assert.equal(resolved.limit, 1_000_000);
});