mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
fix(kiro): strip injected model field from request body (#478)
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().
This commit is contained in:
committed by
GitHub
parent
fe5c20a04e
commit
801b4eef4c
@@ -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<string, unknown>;
|
||||
return rest;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user