From 2db89211a9b414369dfd383a5460c5103e3debf8 Mon Sep 17 00:00:00 2001 From: Skyuno Date: Thu, 12 Feb 2026 16:10:35 +0800 Subject: [PATCH] kiro: use payloadRequestedModel for response model name Align Kiro executor with all other executors (Claude, Gemini, OpenAI, etc.) by using payloadRequestedModel(opts, req.Model) instead of req.Model when constructing response model names. This ensures model aliases are correctly reflected in responses: - Execute: BuildClaudeResponse + TranslateNonStream - ExecuteStream: streamToChannel - handleWebSearchStream: BuildClaudeMessageStartEvent - handleWebSearch: via executeNonStreamFallback (automatic) Previously Kiro was the only executor using req.Model directly, which exposed internal routed names instead of the user's alias. --- internal/runtime/executor/kiro_executor.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/runtime/executor/kiro_executor.go b/internal/runtime/executor/kiro_executor.go index 7bd00205..c9792903 100644 --- a/internal/runtime/executor/kiro_executor.go +++ b/internal/runtime/executor/kiro_executor.go @@ -1033,8 +1033,9 @@ func (e *KiroExecutor) executeWithRetry(ctx context.Context, auth *cliproxyauth. // Build response in Claude format for Kiro translator // stopReason is extracted from upstream response by parseEventStream - kiroResponse := kiroclaude.BuildClaudeResponse(content, toolUses, req.Model, usageInfo, stopReason) - out := sdktranslator.TranslateNonStream(ctx, to, from, req.Model, bytes.Clone(opts.OriginalRequest), body, kiroResponse, nil) + requestedModel := payloadRequestedModel(opts, req.Model) + kiroResponse := kiroclaude.BuildClaudeResponse(content, toolUses, requestedModel, usageInfo, stopReason) + out := sdktranslator.TranslateNonStream(ctx, to, from, requestedModel, bytes.Clone(opts.OriginalRequest), body, kiroResponse, nil) resp = cliproxyexecutor.Response{Payload: []byte(out)} return resp, nil } @@ -1431,7 +1432,7 @@ func (e *KiroExecutor) executeStreamWithRetry(ctx context.Context, auth *cliprox // So we always enable thinking parsing for Kiro responses log.Debugf("kiro: stream thinkingEnabled = %v (always true for Kiro)", thinkingEnabled) - e.streamToChannel(ctx, resp.Body, out, from, req.Model, opts.OriginalRequest, body, reporter, thinkingEnabled) + e.streamToChannel(ctx, resp.Body, out, from, payloadRequestedModel(opts, req.Model), opts.OriginalRequest, body, reporter, thinkingEnabled) }(httpResp, thinkingEnabled) return out, nil