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:
@@ -27,7 +27,8 @@ import { FORMATS } from "../formats.js";
|
||||
import { applyKiroSessionReplay } from "../../utils/kiroSessionReplay.js";
|
||||
import { resolveContinuationId, resolveSessionIdentity } from "../../utils/sessionManager.js";
|
||||
import {
|
||||
resolveKiroModel,
|
||||
resolveKiroModelIntent,
|
||||
applyKiroThinkingOverride,
|
||||
resolveKiroThinkingBudget,
|
||||
buildThinkingSystemPrefix,
|
||||
KIRO_AGENTIC_SYSTEM_PROMPT,
|
||||
@@ -389,10 +390,12 @@ export function claudeToKiroRequest(model, body, stream, credentials) {
|
||||
const temperature = body.temperature;
|
||||
const topP = body.top_p;
|
||||
|
||||
const { upstream: upstreamModel, agentic } = resolveKiroModel(model);
|
||||
const thinkingBudget = resolveKiroThinkingBudget(body, credentials?.rawHeaders, model);
|
||||
const additionalModelRequestFields = buildKiroAdditionalModelRequestFieldsForModel(body, upstreamModel);
|
||||
const usesNativeGptEffort = usesKiroNativeGptEffort(body, upstreamModel);
|
||||
const modelIntent = resolveKiroModelIntent(model);
|
||||
const { upstream: upstreamModel, agentic } = modelIntent;
|
||||
const thinkingBody = applyKiroThinkingOverride(body, modelIntent.thinkingOverride);
|
||||
const thinkingBudget = resolveKiroThinkingBudget(thinkingBody, credentials?.rawHeaders, modelIntent.model);
|
||||
const additionalModelRequestFields = buildKiroAdditionalModelRequestFieldsForModel(thinkingBody, upstreamModel);
|
||||
const usesNativeGptEffort = usesKiroNativeGptEffort(thinkingBody, upstreamModel);
|
||||
|
||||
// Guard 1: no client tools → flatten all tool interactions to text.
|
||||
if (!clientProvidedTools) {
|
||||
|
||||
@@ -8,7 +8,8 @@ import { v4 as uuidv4 } from "uuid";
|
||||
import { applyKiroSessionReplay } from "../../utils/kiroSessionReplay.js";
|
||||
import { resolveContinuationId, resolveSessionIdentity } from "../../utils/sessionManager.js";
|
||||
import {
|
||||
resolveKiroModel,
|
||||
resolveKiroModelIntent,
|
||||
applyKiroThinkingOverride,
|
||||
resolveKiroThinkingBudget,
|
||||
buildThinkingSystemPrefix,
|
||||
KIRO_AGENTIC_SYSTEM_PROMPT,
|
||||
@@ -524,10 +525,12 @@ export function openaiToKiroRequest(model, body, stream, credentials) {
|
||||
const temperature = body.temperature;
|
||||
const topP = body.top_p;
|
||||
|
||||
const { upstream: upstreamModel, agentic } = resolveKiroModel(model);
|
||||
const thinkingBudget = resolveKiroThinkingBudget(body, credentials?.rawHeaders, model);
|
||||
const additionalModelRequestFields = buildKiroAdditionalModelRequestFieldsForModel(body, upstreamModel);
|
||||
const usesNativeGptEffort = usesKiroNativeGptEffort(body, upstreamModel);
|
||||
const modelIntent = resolveKiroModelIntent(model);
|
||||
const { upstream: upstreamModel, agentic } = modelIntent;
|
||||
const thinkingBody = applyKiroThinkingOverride(body, modelIntent.thinkingOverride);
|
||||
const thinkingBudget = resolveKiroThinkingBudget(thinkingBody, credentials?.rawHeaders, modelIntent.model);
|
||||
const additionalModelRequestFields = buildKiroAdditionalModelRequestFieldsForModel(thinkingBody, upstreamModel);
|
||||
const usesNativeGptEffort = usesKiroNativeGptEffort(thinkingBody, upstreamModel);
|
||||
|
||||
const { history, currentMessage } = convertMessages(messages, tools, upstreamModel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user