fix(kiro): canonicalize tool history and route API keys correctly
Route API-key inference through Amazon Q first, enforce adjacent one-to-one tool use/result pairs after session replay, and treat payload-invalid HTTP 400 as terminal.
This commit is contained in:
@@ -62,8 +62,13 @@ export function translateRequest(sourceFormat, targetFormat, model, body, stream
|
||||
// Always ensure tool_calls have id (some providers require it)
|
||||
ensureToolCallIds(result);
|
||||
|
||||
// Fix missing tool responses (insert empty tool_result if needed)
|
||||
fixMissingToolResponses(result);
|
||||
// Kiro performs stricter source-aware reconciliation after session replay.
|
||||
// The generic helper inserts OpenAI `role: tool` messages, which a direct
|
||||
// Claude→Kiro translator cannot consume and which cannot repair partial
|
||||
// parallel tool results.
|
||||
if (targetFormat !== FORMATS.KIRO) {
|
||||
fixMissingToolResponses(result);
|
||||
}
|
||||
|
||||
// Capture thinking intent from the original (pre-translation) body, before any
|
||||
// format conversion strips/renames the fields. Applied after translation.
|
||||
|
||||
Reference in New Issue
Block a user