From 801b4eef4c388b97560088aec36dde004990c9bc Mon Sep 17 00:00:00 2001 From: Prakersh Maheshwari Date: Thu, 19 Mar 2026 17:07:44 +0530 Subject: [PATCH] fix(kiro): strip injected model field from request body (#478) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chatCore.ts injects translatedBody.model for all providers after translation. Kiro API (AWS CodeWhisperer) has strict schema validation and rejects unknown top-level fields — only conversationState, profileArn, and inferenceConfig are valid. This causes 100% of Kiro requests to fail with "Improperly formed request". Strip the injected model field in KiroExecutor.transformRequest(). --- open-sse/executors/kiro.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/open-sse/executors/kiro.ts b/open-sse/executors/kiro.ts index a8fe51b365..d80917ec72 100644 --- a/open-sse/executors/kiro.ts +++ b/open-sse/executors/kiro.ts @@ -77,10 +77,13 @@ export class KiroExecutor extends BaseExecutor { } transformRequest(model: string, body: unknown, stream: boolean, credentials: unknown): unknown { - void model; void stream; void credentials; - return body; + // Kiro uses conversationState.currentMessage.userInputMessage.modelId, + // not a top-level "model" field. chatCore injects translatedBody.model + // which Kiro API rejects as unknown top-level field. + const { model: _model, ...rest } = body as Record; + return rest; } /**