diff --git a/changelog.d/fixes/9338-kimi-web-k3-exhausted.md b/changelog.d/fixes/9338-kimi-web-k3-exhausted.md new file mode 100644 index 0000000000..8bf5c7bc88 --- /dev/null +++ b/changelog.d/fixes/9338-kimi-web-k3-exhausted.md @@ -0,0 +1 @@ +- fix(providers): map kimi-web/K3 to K2D5 scenario instead of OK Computer premium mode to fix resource_exhausted on non-subscriber accounts (#9338) diff --git a/open-sse/config/providers/registry/kimi/web/runtime.ts b/open-sse/config/providers/registry/kimi/web/runtime.ts index 9e1c6a0217..1d8ad0b456 100644 --- a/open-sse/config/providers/registry/kimi/web/runtime.ts +++ b/open-sse/config/providers/registry/kimi/web/runtime.ts @@ -12,16 +12,10 @@ export interface KimiWebModelConfig { const STATIC_MODEL_CONFIGS: Record = { k3: { - scenario: "SCENARIO_OK_COMPUTER", - kimiPlusId: "ok-computer", - supportedReasoningEfforts: [ - "REASONING_EFFORT_LOW", - "REASONING_EFFORT_HIGH", - "REASONING_EFFORT_MAX", - ], - defaultReasoningEffort: "REASONING_EFFORT_MAX", - supportedContextLengths: ["CONTEXT_LENGTH_L", "CONTEXT_LENGTH_XL"], - defaultContextLength: "CONTEXT_LENGTH_L", + scenario: "SCENARIO_K2D5", + supportedReasoningEfforts: ["REASONING_EFFORT_NONE", "REASONING_EFFORT_LOW"], + defaultReasoningEffort: "REASONING_EFFORT_NONE", + supportedContextLengths: [], }, k2d6: { scenario: "SCENARIO_K2D5", diff --git a/tests/unit/executor-kimi-web.test.ts b/tests/unit/executor-kimi-web.test.ts index 8a2a14c5e5..85c99e3522 100644 --- a/tests/unit/executor-kimi-web.test.ts +++ b/tests/unit/executor-kimi-web.test.ts @@ -110,16 +110,16 @@ describe("KimiWebExecutor", () => { }; }; assert.equal(request.chat_id, ""); - assert.equal(request.kimiplus_id, "ok-computer"); - assert.equal(request.scenario, "SCENARIO_OK_COMPUTER"); + assert.equal(request.kimiplus_id, undefined); + assert.equal(request.scenario, "SCENARIO_K2D5"); assert.equal(request.model, undefined); assert.deepEqual(request.tools, []); assert.equal(request.message.blocks[0].text.content, "hi"); assert.equal(request.options.system_prompt, "Be terse."); assert.equal(request.options.thinking, true); assert.equal(request.options.enable_plugin, false); - assert.equal(request.options.reasoning_effort, "REASONING_EFFORT_MAX"); - assert.equal(request.options.context_length, "CONTEXT_LENGTH_L"); + assert.equal(request.options.reasoning_effort, "REASONING_EFFORT_NONE"); + assert.equal(request.options.context_length, undefined); } finally { globalThis.fetch = originalFetch; } @@ -166,19 +166,18 @@ describe("KimiWebExecutor", () => { describe("resolveModelConfig", () => { const { resolveModelConfig } = mod; - it("maps k3 to the current OK Computer route", () => { + it("maps k3 to the K2D5 route (same as K2.6, not premium OK Computer)", () => { const cfg = resolveModelConfig("k3"); assert.ok(cfg); - assert.equal(cfg.scenario, "SCENARIO_OK_COMPUTER"); - assert.equal(cfg.kimiPlusId, "ok-computer"); + assert.equal(cfg.scenario, "SCENARIO_K2D5"); + assert.equal(cfg.kimiPlusId, undefined); assert.deepEqual(cfg.supportedReasoningEfforts, [ + "REASONING_EFFORT_NONE", "REASONING_EFFORT_LOW", - "REASONING_EFFORT_HIGH", - "REASONING_EFFORT_MAX", ]); - assert.equal(cfg.defaultReasoningEffort, "REASONING_EFFORT_MAX"); - assert.deepEqual(cfg.supportedContextLengths, ["CONTEXT_LENGTH_L", "CONTEXT_LENGTH_XL"]); - assert.equal(cfg.defaultContextLength, "CONTEXT_LENGTH_L"); + assert.equal(cfg.defaultReasoningEffort, "REASONING_EFFORT_NONE"); + assert.deepEqual(cfg.supportedContextLengths, []); + assert.equal(cfg.defaultContextLength, undefined); }); it("maps k2d6 to the K2D5 route and its exact effort enum", () => {