fix(kiro): normalize dashboard thinking intensity models

Strip the generic dashboard model(level) suffix before resolving Kiro
synthetic -thinking/-agentic variants so the upstream request no longer
carries an invalid parenthesized model id. Map explicit levels to native
Kiro effort fields only for supported Claude/GPT model families, and stop
advertising native levels for unsupported legacy Kiro models. Applies to
both OpenAI→Kiro and direct Claude→Kiro routes.
This commit is contained in:
ankit1324
2026-07-23 16:26:22 +07:00
committed by decolua
parent e45bd73d6e
commit 007d372724
7 changed files with 103 additions and 11 deletions

View File

@@ -424,6 +424,31 @@ describe("openaiToKiroRequest", () => {
expect(result.additionalModelRequestFields).toBeUndefined();
});
it.each([
["claude-sonnet-4.5-thinking-agentic(high)", "claude-sonnet-4.5"],
["glm-5-thinking-agentic(medium)", "glm-5"],
])("normalizes unsupported Kiro intensity suffix for %s", (model, upstream) => {
const result = openaiToKiroRequest(model, {
messages: [{ role: "user", content: "hello" }],
}, true, {});
expect(result.conversationState.currentMessage.userInputMessage.modelId).toBe(upstream);
expect(result.additionalModelRequestFields).toBeUndefined();
expect(systemPromptOf(result)).toContain("CHUNKED WRITE PROTOCOL");
});
it("maps a supported Kiro Claude intensity suffix to native effort fields", () => {
const result = openaiToKiroRequest("claude-sonnet-5-thinking-agentic(high)", {
messages: [{ role: "user", content: "hello" }],
}, true, {});
expect(result.conversationState.currentMessage.userInputMessage.modelId).toBe("claude-sonnet-5");
expect(result.additionalModelRequestFields).toEqual({
thinking: { type: "adaptive", display: "summarized" },
output_config: { effort: "high" },
});
});
it("does not send additionalModelRequestFields for date-suffixed Claude 4 model ids", () => {
const body = {
reasoning_effort: "high",