mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Kiro sends modelId "auto" for the main agent turn; without a defaultModels slot getMappedModel returned null and the call leaked to AWS instead of the configured provider. Adds the slot + guard test. Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import { describe, expect, it } from "vitest";
|
|
import { MITM_TOOLS } from "../../src/shared/constants/cliTools.js";
|
|
|
|
// Guards the fix in commit 356607c: Kiro's agent/"vibe" mode sends modelId
|
|
// "auto" for the main turn and "simple-task" for background sub-tasks. Both
|
|
// need a mappable defaultModels slot — otherwise getMappedModel (src/mitm/server.js)
|
|
// returns null and the /generateAssistantResponse call is passed through to AWS
|
|
// instead of being routed to the user's chosen provider (surfacing as Kiro's
|
|
// "monthly usage limit" once the AWS quota is gone).
|
|
describe("Kiro MITM model slots", () => {
|
|
const kiro = MITM_TOOLS.kiro;
|
|
|
|
it("exposes the kiro mitm tool", () => {
|
|
expect(kiro).toBeTruthy();
|
|
expect(kiro.configType).toBe("mitm");
|
|
expect(Array.isArray(kiro.defaultModels)).toBe(true);
|
|
});
|
|
|
|
it("offers a mappable slot for the agent default model id 'auto'", () => {
|
|
const auto = kiro.defaultModels.find((m) => m.id === "auto");
|
|
expect(auto).toBeTruthy();
|
|
expect(auto.alias).toBe("auto");
|
|
});
|
|
|
|
it("offers a mappable slot for the background sub-task model id 'simple-task'", () => {
|
|
const simpleTask = kiro.defaultModels.find((m) => m.id === "simple-task");
|
|
expect(simpleTask).toBeTruthy();
|
|
expect(simpleTask.alias).toBe("simple-task");
|
|
});
|
|
});
|