From 4721c58d9c16ee0226224e4a666407f910dacf48 Mon Sep 17 00:00:00 2001 From: Cc Date: Fri, 16 Jan 2026 13:22:43 +0800 Subject: [PATCH 1/2] fix(kiro): correct Amazon Q endpoint URL path The Q endpoint was using `/` which caused all requests to fail with 400 or UnknownOperationException. Changed to `/generateAssistantResponse` which is the correct path for the Q endpoint. This fix restores the Q endpoint failover functionality. Co-Authored-By: Claude Opus 4.5 --- internal/runtime/executor/kiro_executor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/runtime/executor/kiro_executor.go b/internal/runtime/executor/kiro_executor.go index 4d3c9749..fe90b403 100644 --- a/internal/runtime/executor/kiro_executor.go +++ b/internal/runtime/executor/kiro_executor.go @@ -98,7 +98,7 @@ var kiroEndpointConfigs = []kiroEndpointConfig{ Name: "CodeWhisperer", }, { - URL: "https://q.us-east-1.amazonaws.com/", + URL: "https://q.us-east-1.amazonaws.com/generateAssistantResponse", Origin: "CLI", AmzTarget: "AmazonQDeveloperStreamingService.SendMessage", Name: "AmazonQ", From 778cf4af9ea1f0f498aa6c9abec367135588b8fe Mon Sep 17 00:00:00 2001 From: Cc Date: Fri, 16 Jan 2026 14:21:38 +0800 Subject: [PATCH 2/2] feat(kiro): add agent-mode and optout headers for non-IDC auth - Add x-amzn-kiro-agent-mode: vibe for non-IDC auth (Social, Builder ID) IDC auth continues to use "spec" mode - Add x-amzn-codewhisperer-optout: true for all auth types This opts out of data sharing for service improvement (privacy) These changes align with other Kiro implementations (kiro.rs, KiroGate, kiro-gateway, AIClient-2-API) and make requests more similar to real Kiro IDE clients. Co-Authored-By: Claude Opus 4.5 --- internal/runtime/executor/kiro_executor.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/runtime/executor/kiro_executor.go b/internal/runtime/executor/kiro_executor.go index fe90b403..3d152955 100644 --- a/internal/runtime/executor/kiro_executor.go +++ b/internal/runtime/executor/kiro_executor.go @@ -53,6 +53,7 @@ const ( kiroIDEUserAgent = "aws-sdk-js/1.0.18 ua/2.1 os/darwin#25.0.0 lang/js md/nodejs#20.16.0 api/codewhispererstreaming#1.0.18 m/E KiroIDE-0.2.13-66c23a8c5d15afabec89ef9954ef52a119f10d369df04d548fc6c1eac694b0d1" kiroIDEAmzUserAgent = "aws-sdk-js/1.0.18 KiroIDE-0.2.13-66c23a8c5d15afabec89ef9954ef52a119f10d369df04d548fc6c1eac694b0d1" kiroIDEAgentModeSpec = "spec" + kiroAgentModeVibe = "vibe" ) // Real-time usage estimation configuration @@ -232,7 +233,9 @@ func (e *KiroExecutor) PrepareRequest(req *http.Request, auth *cliproxyauth.Auth } else { req.Header.Set("User-Agent", kiroUserAgent) req.Header.Set("X-Amz-User-Agent", kiroFullUserAgent) + req.Header.Set("x-amzn-kiro-agent-mode", kiroAgentModeVibe) } + req.Header.Set("x-amzn-codewhisperer-optout", "true") req.Header.Set("Amz-Sdk-Request", "attempt=1; max=3") req.Header.Set("Amz-Sdk-Invocation-Id", uuid.New().String()) req.Header.Set("Authorization", "Bearer "+accessToken) @@ -350,7 +353,9 @@ func (e *KiroExecutor) executeWithRetry(ctx context.Context, auth *cliproxyauth. } else { httpReq.Header.Set("User-Agent", kiroUserAgent) httpReq.Header.Set("X-Amz-User-Agent", kiroFullUserAgent) + httpReq.Header.Set("x-amzn-kiro-agent-mode", kiroAgentModeVibe) } + httpReq.Header.Set("x-amzn-codewhisperer-optout", "true") httpReq.Header.Set("Amz-Sdk-Request", "attempt=1; max=3") httpReq.Header.Set("Amz-Sdk-Invocation-Id", uuid.New().String()) @@ -683,7 +688,9 @@ func (e *KiroExecutor) executeStreamWithRetry(ctx context.Context, auth *cliprox } else { httpReq.Header.Set("User-Agent", kiroUserAgent) httpReq.Header.Set("X-Amz-User-Agent", kiroFullUserAgent) + httpReq.Header.Set("x-amzn-kiro-agent-mode", kiroAgentModeVibe) } + httpReq.Header.Set("x-amzn-codewhisperer-optout", "true") httpReq.Header.Set("Amz-Sdk-Request", "attempt=1; max=3") httpReq.Header.Set("Amz-Sdk-Invocation-Id", uuid.New().String())