mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-25 09:25:59 +03:00
[GH-ISSUE #272] Request failed with status code 400 with model: claude-sonnet-4-5 not 4.5, Local version: 2.7.7.4 #188
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @candowu on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/272
11
2026/1/21 11:22:39
[Server] Received request: POST http://localhost:3000/claude-kiro-oauth/v1/messages?beta=true
[Config] MODEL_PROVIDER overridden by path segment to: claude-kiro-oauth
[API Service] Using pooled configuration for claude-kiro-oauth: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Adapter] getServiceAdapter, provider: claude-kiro-oauth, uuid: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Content Generation] Model: claude-sonnet-4-5, Stream: true
[Adapter] getServiceAdapter, provider: claude-kiro-oauth, uuid: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Content Generation] Re-selected service adapter based on model: claude-sonnet-4-5
[Request Convert] Request format matches backend provider. No conversion needed.
[System Prompt Manager] System prompt updated in file for provider 'claude'.
[Kiro] Calling generateContentStream with model: claude-sonnet-4-5 (real streaming)
[Kiro] Ignoring tool: WebSearch
[Kiro] Truncated tool 'Bash' description: 9777 -> 9219 chars
[Kiro] Truncated tool 'TodoWrite' description: 9701 -> 9219 chars
[Kiro] Truncated 2 tool description(s) to max 9216 chars
[ProviderPoolManager] configs/provider_pools.json updated successfully for types: claude-kiro-oauth
[API Potluck] Running initial health sync from pool...
[API Potluck UserData] File watcher started for config hot-reload
[API Potluck] Health sync complete: 0/0 healthy
[Kiro] Stream API call failed (Status: 400, Code: ERR_BAD_REQUEST): Request failed with status code 400
[Kiro] Error in streaming generation: AxiosError: Request failed with status code 400
at settle (file:///Users/candowu/code/AIClient-2-API/node_modules/axios/lib/core/settle.js:19:12)
at RedirectableRequest.handleResponse (file:///Users/candowu/code/AIClient-2-API/node_modules/axios/lib/adapters/http.js:547:9)
at RedirectableRequest.emit (node:events:530:35)
at RedirectableRequest._processResponse (/Users/candowu/code/AIClient-2-API/node_modules/follow-redirects/index.js:409:10)
at RedirectableRequest._onNativeResponse (/Users/candowu/code/AIClient-2-API/node_modules/follow-redirects/index.js:102:12)
at Object.onceWrapper (node:events:633:26)
at ClientRequest.emit (node:events:518:28)
at HTTPParser.parserOnIncomingClient (node:_http_client:716:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
at TLSSocket.socketOnData (node:_http_client:558:22)
at Axios.request (file:///Users/candowu/code/AIClient-2-API/node_modules/axios/lib/core/Axios.js:45:41)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async KiroApiService.streamApiReal (file:///Users/candowu/code/AIClient-2-API/src/providers/claude/claude-kiro.js:1806:30)
at async KiroApiService.generateContentStream (file:///Users/candowu/code/AIClient-2-API/src/providers/claude/claude-kiro.js:2078:30)
at async KiroApiServiceAdapter.generateContentStream (file:///Users/candowu/code/AIClient-2-API/src/providers/adapter.js:353:9)
at async handleStreamRequest (file:///Users/candowu/code/AIClient-2-API/src/utils/common.js:254:26)
at async handleContentGenerationRequest (file:///Users/candowu/code/AIClient-2-API/src/utils/common.js:678:9)
at async handleAPIRequests (file:///Users/candowu/code/AIClient-2-API/src/services/api-manager.js:52:13)
at async Server.requestHandler (file:///Users/candowu/code/AIClient-2-API/src/handlers/request-handler.js:232:32) {
code: 'ERR_BAD_REQUEST',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http', 'fetch' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 120000,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function [FormData]], Blob: [class Blob] },
validateStatus: [Function: validateStatus],
headers: Object [AxiosHeaders] {
Accept: 'application/json',
'Content-Type': 'application/json',
'amz-sdk-request': 'attempt=1; max=1',
'x-amzn-kiro-agent-mode': 'vibe',
'x-amz-user-agent': 'aws-sdk-js/1.0.0 KiroIDE-0.8.140-aff461954a092f1ff784198030cdc69a142bdde54e540f6451d5c84e4dcd5f3c',
'user-agent': 'aws-sdk-js/1.0.0 ua/2.1 os/macos#24.3.0 lang/js md/nodejs#22.14.0 api/codewhispererruntime#1.0.0 m/E KiroIDE-0.8.140-aff461954a092f1ff784198030cdc69a142bdde54e540f6451d5c84e4dcd5f3c',
Connection: 'close',
Authorization: 'Bearer aoaAAAAAGlwVHUbzTt0umhuXXVp54SYwCO8Rp36gFDakoRZJlCYAM7pVKjbrgTHtUENZ4a15ViEEXfgR0k09QCNJUBkc0:MGQCMFKkph/iN1jQ3SEvk5QpdMwfwpFSVvCcZP0I7Bcn+DX7rLI4zMSpv0K4joW41v6t1wIwcFJrDe/czRsA2fPnDu69LkSWz+VFlEX3F3utPlfZNeC63jq7Ci2VUNKrMxcqjw64',
'amz-sdk-invocation-id': 'cf990d2f-8a08-4776-9a5f-c21bc235e845',
'Content-Length': '290653',
'Accept-Encoding': 'gzip, compress, deflate, br'
},
httpAgent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 80,
protocol: 'http:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype] {},
freeSockets: [Object: null prototype] {},
keepAliveMsecs: 1000,
keepAlive: true,
maxSockets: 100,
maxFreeSockets: 5,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 0,
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false
},
httpsAgent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype],
freeSockets: [Object: null prototype],
keepAliveMsecs: 1000,
keepAlive: true,
maxSockets: 100,
maxFreeSockets: 5,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 3,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false
},
proxy: false,
responseType: 'stream',
method: 'post',
url: 'https://q.us-east-1.amazonaws.com/generateAssistantResponse',
data: '{"conversationState":{"chatTriggerType":"MANUAL","conversationId":"4819f143-ffc3-4347-8560-4a377bf1a508","currentMessage":{"userInputMessage":{"content":"continue","modelId":"CLAUDE_SONNET_4_5_20250929_V1_0","origin":"AI_EDITOR","userInputMessageContext":{"tools":[{"toolSpecification":{"name":"Task","description":"Launch a new agent to handle complex, multi-step tasks autonomously. \n\nThe Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types and the tools they have access to:\n- Bash: Command execution specialist for running bash commands. Use this for git operations, command execution, and other terminal tasks. (Tools: Bash)\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: )\n- statusline-setup: Use this agent to configure the user's Claude Code status line setting. (Tools: Read, Edit)\n- Explore: Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. \"src/components/**/.tsx\"), search code for keywords (eg. \"API endpoints\"), or answer questions about the codebase (eg. \"how do API endpoints work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"very thorough\" for comprehensive analysis across multiple locations and naming conventions. (Tools: All tools except Task, ExitPlanMode, Edit, Write, NotebookEdit)\n- Plan: Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs. (Tools: All tools except Task, ExitPlanMode, Edit, Write, NotebookEdit)\n- claude-code-guide: Use this agent when the user asks questions (\"Can Claude...\", \"Does Claude...\", \"How do I...\") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. IMPORTANT: Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can resume using the \"resume\" parameter. (Tools: Glob, Grep, Read, WebFetch, WebSearch)\n- superpowers:code-reviewer: Use this agent when a major project step has been completed and needs to be reviewed against the original plan and coding standards. Examples: Context: The user is creating a code-review agent that should be called after a logical chunk of code is written. user: \"I've finished implementing the user authentication system as outlined in step 3 of our plan\" assistant: \"Great work! Now let me use the code-reviewer agent to review the implementation against our plan and coding standards\" Since a major project step has been completed, use the code-reviewer agent to validate the work against the plan and identify any issues. Context: User has completed a significant feature implementation. user: \"The API endpoints for the task management system are now complete - that covers step 2 from our architecture document\" assistant: \"Excellent! Let me have the code-reviewer agent examine this implementation to ensure it aligns with our plan and follows best practices\" A numbered step from the planning document has been completed, so the code-reviewer agent should review the work.\n (Tools: All tools)\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\nWhen NOT to use the Task tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Task tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n- Always include a short description (3-5 words) summarizing what the agent will do\n- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n- You can optionally run agents in the background using the run_in_background parameter. When an agent runs in the background, the tool result will include an output_file path. To check on the agent's progress or retrieve its results, use the Read tool to read the output file, or use Bash with
tailto see recent output. You can continue working while background agents run.\n- Agents can be resumed using theresumeparameter by passing the agent ID from a previous invocation. When resumed, the agent continues with its full previous context preserved. When NOT resuming, each invocation starts fresh and you should provide a detailed task description with all necessary context.\n- When the agent is done, it will return a single message back to you along with its agent ID. You can use this ID to resume the agent later if needed for follow-up work.\n- Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need.\n- Agents with \"access to current context\" can see the full conversation history before the tool call. When using these agents, you can write concise prompts that reference earlier context (e.g., \"investigate the error discussed above\") instead of repeating information. The agent will receive all prior messages and understand the context.\n- The agent's outputs should generally be trusted\n- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n- If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n- If the user specifies that they want you to run agents \"in parallel\", you MUST send a single message with multiple Task tool use content blocks. For example, if you need to launch both a build-validator agent and a test-runner agent in parallel, send a single message with both tool calls.\n\nExample usage:\n\n<example_agent_descriptions>\n\"test-runner\": use this agent after you are done writing code to run tests\n\"greeting-responder\": use this agent when to respond to user greetings with a friendly joke\n</example_agent_description>\n\n\nuser: \"Please write a function that checks if a number is prime\"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I'm going to use the Write tool to write the following code:\n\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n\n\nSince a significant piece of code was written and the task was completed, now use the test-runner agent to run the tests\n\nassistant: Now let me use the test-runner agent to run the tests\nassistant: Uses the Task tool to launch the test-runner agent\n\n\n\nuser: \"Hello\"\n\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n\nassistant: \"I'm going to use the Task tool to launch the greeting-responder agent\"\n\n","inputSchema":{"json":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"description":"A short (3-5 word) description of the task","type":"string"},"prompt":{"description":"The task for the agent to perform","type":"string"},"subagent_type":{"description":"The type of specialized agent to use for this task","type":"string"},"model":{"description":"Optional model to use for this agent. If not specified, inherits from parent. Prefer haiku for quick, straightforward tasks to minimize cost and latency.","type":"string","enum":["sonnet","opus","haiku"]},"resume":{"description":"Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript.","type":"string"},"run_in_background":{"description":"Set to true to run this agent in the background. The tool result will include an output_file path - use Read tool or Bash tail to check on output.","type":"boolean"},"max_turns":{"description":"Maximum number of agentic turns (API round-trips) before stopping. Used internally for warmup.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["description","prompt","subagent_type"],"additionalProperties":false}}}},{"toolSpecification":{"name":"TaskOutput","description":"- Retrieves output from a running or completed task (background shell, agent, or remote session)\n- Takes a task_id parameter identifying the task\n- Returns the task output along with status information\n- Use block=true (default) to wait for task completion\n- Use block=false for non-blocking check of current status\n- Task IDs can be found using the /tasks comm'... 277747 more characters,allowAbsoluteUrls: true
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
connect: [Function (anonymous)],
error: [Function (anonymous)],
socket: [Function (anonymous)],
timeout: [Function (anonymous)],
finish: [Function: requestOnFinish]
},
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: '290653',
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
_header: 'POST /generateAssistantResponse HTTP/1.1\r\n' +
'Accept: application/json\r\n' +
'Content-Type: application/json\r\n' +
'amz-sdk-request: attempt=1; max=1\r\n' +
'x-amzn-kiro-agent-mode: vibe\r\n' +
'x-amz-user-agent: aws-sdk-js/1.0.0 KiroIDE-0.8.140-aff461954a092f1ff784198030cdc69a142bdde54e540f6451d5c84e4dcd5f3c\r\n' +
'user-agent: aws-sdk-js/1.0.0 ua/2.1 os/macos#24.3.0 lang/js md/nodejs#22.14.0 api/codewhispererruntime#1.0.0 m/E KiroIDE-0.8.140-aff461954a092f1ff784198030cdc69a142bdde54e540f6451d5c84e4dcd5f3c\r\n' +
'Connection: close\r\n' +
'Authorization: Bearer aoaAAAAAGlwVHUbzTt0umhuXXVp54SYwCO8Rp36gFDakoRZJlCYAM7pVKjbrgTHtUENZ4a15ViEEXfgR0k09QCNJUBkc0:MGQCMFKkph/iN1jQ3SEvk5QpdMwfwpFSVvCcZP0I7Bcn+DX7rLI4zMSpv0K4joW41v6t1wIwcFJrDe/czRsA2fPnDu69LkSWz+VFlEX3F3utPlfZNeC63jq7Ci2VUNKrMxcqjw64\r\n' +
'amz-sdk-invocation-id: cf990d2f-8a08-4776-9a5f-c21bc235e845\r\n' +
'Content-Length: 290653\r\n' +
'Accept-Encoding: gzip, compress, deflate, br\r\n' +
'Host: q.us-east-1.amazonaws.com\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype],
freeSockets: [Object: null prototype],
keepAliveMsecs: 1000,
keepAlive: true,
maxSockets: 100,
maxFreeSockets: 5,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 3,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/generateAssistantResponse',
_ended: false,
res: IncomingMessage {
_events: [Object],
_readableState: [ReadableState],
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
joinDuplicateHeaders: undefined,
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 400,
statusMessage: 'Bad Request',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular *1],
_eventsCount: 4,
responseUrl: 'https://q.us-east-1.amazonaws.com/generateAssistantResponse',
redirects: [],
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 22,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: [Function: emitRequestTimeout],
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'q.us-east-1.amazonaws.com',
protocol: 'https:',
_redirectable: Writable {
_events: [Object],
_writableState: [WritableState],
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 290653,
_requestBodyBuffers: [],
_eventsCount: 3,
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'https://q.us-east-1.amazonaws.com/generateAssistantResponse',
_timeout: null,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false
},
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kChunkedBuffer)]: [],
[Symbol(kChunkedLength)]: 0,
[Symbol(kSocket)]: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: 'q.us-east-1.amazonaws.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'q.us-east-1.amazonaws.com',
_closeAfterHandlingError: false,
_readableState: [ReadableState],
_writableState: [WritableState],
allowHalfOpen: false,
_maxListeners: undefined,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: null,
_requestCert: true,
_rejectUnauthorized: true,
timeout: 120000,
parser: null,
_httpMessage: [Circular *1],
autoSelectFamilyAttemptedAddresses: [Array],
handle: [TLSWrap],
[Symbol(alpncallback)]: null,
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 3032,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: 120000,
_idlePrev: [TimersList],
_idleNext: [Timeout],
_idleStart: 30473,
_onTimeout: [Function: bound ],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: false,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 3011,
[Symbol(triggerId)]: 3003,
[Symbol(kAsyncContextFrame)]: undefined
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: false,
[Symbol(kSetKeepAlive)]: true,
[Symbol(kSetKeepAliveInitialDelay)]: 60,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'content-type': [Array],
'amz-sdk-request': [Array],
'x-amzn-kiro-agent-mode': [Array],
'x-amz-user-agent': [Array],
'user-agent': [Array],
connection: [Array],
authorization: [Array],
'amz-sdk-invocation-id': [Array],
'content-length': [Array],
'accept-encoding': [Array],
host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 65536,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null
},
response: {
status: 400,
statusText: 'Bad Request',
headers: Object [AxiosHeaders] {
date: 'Wed, 21 Jan 2026 03:22:43 GMT',
'content-type': 'application/json',
'content-length': '54',
connection: 'close',
'x-amzn-requestid': 'b3013db1-0443-4f53-b6fe-f33219c5c5a1',
'x-xss-protection': '1; mode=block',
'strict-transport-security': 'max-age=47304000; includeSubDomains',
'x-frame-options': 'DENY',
'x-amzn-errortype': 'ValidationException:http://internal.amazon.com/coral/com.amazon.aws.codewhisperer/',
'cache-control': 'no-cache',
'x-content-type-options': 'nosniff'
},
config: {
transitional: [Object],
adapter: [Array],
transformRequest: [Array],
transformResponse: [Array],
timeout: 120000,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: [Object],
validateStatus: [Function: validateStatus],
headers: [Object [AxiosHeaders]],
httpAgent: [Agent],
httpsAgent: [Agent],
proxy: false,
responseType: 'stream',
method: 'post',
url: 'https://q.us-east-1.amazonaws.com/generateAssistantResponse',
data: '{"conversationState":{"chatTriggerType":"MANUAL","conversationId":"4819f143-ffc3-4347-8560-4a377bf1a508","currentMessage":{"userInputMessage":{"content":"continue","modelId":"CLAUDE_SONNET_4_5_20250929_V1_0","origin":"AI_EDITOR","userInputMessageContext":{"tools":[{"toolSpecification":{"name":"Task","description":"Launch a new agent to handle complex, multi-step tasks autonomously. \n\nThe Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types and the tools they have access to:\n- Bash: Command execution specialist for running bash commands. Use this for git operations, command execution, and other terminal tasks. (Tools: Bash)\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: )\n- statusline-setup: Use this agent to configure the user's Claude Code status line setting. (Tools: Read, Edit)\n- Explore: Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. \"src/components/**/.tsx\"), search code for keywords (eg. \"API endpoints\"), or answer questions about the codebase (eg. \"how do API endpoints work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"very thorough\" for comprehensive analysis across multiple locations and naming conventions. (Tools: All tools except Task, ExitPlanMode, Edit, Write, NotebookEdit)\n- Plan: Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs. (Tools: All tools except Task, ExitPlanMode, Edit, Write, NotebookEdit)\n- claude-code-guide: Use this agent when the user asks questions (\"Can Claude...\", \"Does Claude...\", \"How do I...\") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. IMPORTANT: Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can resume using the \"resume\" parameter. (Tools: Glob, Grep, Read, WebFetch, WebSearch)\n- superpowers:code-reviewer: Use this agent when a major project step has been completed and needs to be reviewed against the original plan and coding standards. Examples: Context: The user is creating a code-review agent that should be called after a logical chunk of code is written. user: \"I've finished implementing the user authentication system as outlined in step 3 of our plan\" assistant: \"Great work! Now let me use the code-reviewer agent to review the implementation against our plan and coding standards\" Since a major project step has been completed, use the code-reviewer agent to validate the work against the plan and identify any issues. Context: User has completed a significant feature implementation. user: \"The API endpoints for the task management system are now complete - that covers step 2 from our architecture document\" assistant: \"Excellent! Let me have the code-reviewer agent examine this implementation to ensure it aligns with our plan and follows best practices\" A numbered step from the planning document has been completed, so the code-reviewer agent should review the work.\n (Tools: All tools)\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\nWhen NOT to use the Task tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Task tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n- Always include a short description (3-5 words) summarizing what the agent will do\n- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n- You can optionally run agents in the background using the run_in_background parameter. When an agent runs in the background, the tool result will include an output_file path. To check on the agent's progress or retrieve its results, use the Read tool to read the output file, or use Bash with
tailto see recent output. You can continue working while background agents run.\n- Agents can be resumed using theresumeparameter by passing the agent ID from a previous invocation. When resumed, the agent continues with its full previous context preserved. When NOT resuming, each invocation starts fresh and you should provide a detailed task description with all necessary context.\n- When the agent is done, it will return a single message back to you along with its agent ID. You can use this ID to resume the agent later if needed for follow-up work.\n- Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need.\n- Agents with \"access to current context\" can see the full conversation history before the tool call. When using these agents, you can write concise prompts that reference earlier context (e.g., \"investigate the error discussed above\") instead of repeating information. The agent will receive all prior messages and understand the context.\n- The agent's outputs should generally be trusted\n- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n- If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n- If the user specifies that they want you to run agents \"in parallel\", you MUST send a single message with multiple Task tool use content blocks. For example, if you need to launch both a build-validator agent and a test-runner agent in parallel, send a single message with both tool calls.\n\nExample usage:\n\n<example_agent_descriptions>\n\"test-runner\": use this agent after you are done writing code to run tests\n\"greeting-responder\": use this agent when to respond to user greetings with a friendly joke\n</example_agent_description>\n\n\nuser: \"Please write a function that checks if a number is prime\"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I'm going to use the Write tool to write the following code:\n\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n\n\nSince a significant piece of code was written and the task was completed, now use the test-runner agent to run the tests\n\nassistant: Now let me use the test-runner agent to run the tests\nassistant: Uses the Task tool to launch the test-runner agent\n\n\n\nuser: \"Hello\"\n\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n\nassistant: \"I'm going to use the Task tool to launch the greeting-responder agent\"\n\n","inputSchema":{"json":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"description":"A short (3-5 word) description of the task","type":"string"},"prompt":{"description":"The task for the agent to perform","type":"string"},"subagent_type":{"description":"The type of specialized agent to use for this task","type":"string"},"model":{"description":"Optional model to use for this agent. If not specified, inherits from parent. Prefer haiku for quick, straightforward tasks to minimize cost and latency.","type":"string","enum":["sonnet","opus","haiku"]},"resume":{"description":"Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript.","type":"string"},"run_in_background":{"description":"Set to true to run this agent in the background. The tool result will include an output_file path - use Read tool or Bash tail to check on output.","type":"boolean"},"max_turns":{"description":"Maximum number of agentic turns (API round-trips) before stopping. Used internally for warmup.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["description","prompt","subagent_type"],"additionalProperties":false}}}},{"toolSpecification":{"name":"TaskOutput","description":"- Retrieves output from a running or completed task (background shell, agent, or remote session)\n- Takes a task_id parameter identifying the task\n- Returns the task output along with status information\n- Use block=true (default) to wait for task completion\n- Use block=false for non-blocking check of current status\n- Task IDs can be found using the /tasks comm'... 277747 more characters,allowAbsoluteUrls: true
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: '290653',
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
_header: 'POST /generateAssistantResponse HTTP/1.1\r\n' +
'Accept: application/json\r\n' +
'Content-Type: application/json\r\n' +
'amz-sdk-request: attempt=1; max=1\r\n' +
'x-amzn-kiro-agent-mode: vibe\r\n' +
'x-amz-user-agent: aws-sdk-js/1.0.0 KiroIDE-0.8.140-aff461954a092f1ff784198030cdc69a142bdde54e540f6451d5c84e4dcd5f3c\r\n' +
'user-agent: aws-sdk-js/1.0.0 ua/2.1 os/macos#24.3.0 lang/js md/nodejs#22.14.0 api/codewhispererruntime#1.0.0 m/E KiroIDE-0.8.140-aff461954a092f1ff784198030cdc69a142bdde54e540f6451d5c84e4dcd5f3c\r\n' +
'Connection: close\r\n' +
'Authorization: Bearer aoaAAAAAGlwVHUbzTt0umhuXXVp54SYwCO8Rp36gFDakoRZJlCYAM7pVKjbrgTHtUENZ4a15ViEEXfgR0k09QCNJUBkc0:MGQCMFKkph/iN1jQ3SEvk5QpdMwfwpFSVvCcZP0I7Bcn+DX7rLI4zMSpv0K4joW41v6t1wIwcFJrDe/czRsA2fPnDu69LkSWz+VFlEX3F3utPlfZNeC63jq7Ci2VUNKrMxcqjw64\r\n' +
'amz-sdk-invocation-id: cf990d2f-8a08-4776-9a5f-c21bc235e845\r\n' +
'Content-Length: 290653\r\n' +
'Accept-Encoding: gzip, compress, deflate, br\r\n' +
'Host: q.us-east-1.amazonaws.com\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/generateAssistantResponse',
_ended: false,
res: [IncomingMessage],
aborted: false,
timeoutCb: [Function: emitRequestTimeout],
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'q.us-east-1.amazonaws.com',
protocol: 'https:',
_redirectable: [Writable],
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kChunkedBuffer)]: [],
[Symbol(kChunkedLength)]: 0,
[Symbol(kSocket)]: [TLSSocket],
[Symbol(kOutHeaders)]: [Object: null prototype],
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 65536,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null
},
data: IncomingMessage {
_events: [Object],
_readableState: [ReadableState],
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
joinDuplicateHeaders: undefined,
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 400,
statusMessage: 'Bad Request',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [ClientRequest],
_eventsCount: 4,
responseUrl: 'https://q.us-east-1.amazonaws.com/generateAssistantResponse',
redirects: [],
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 22,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0
}
},
status: 400
}
[Server] Error during stream processing: Error: Error processing response: Request failed with status code 400
at KiroApiService.generateContentStream (file:///Users/candowu/code/AIClient-2-API/src/providers/claude/claude-kiro.js:2329:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async KiroApiServiceAdapter.generateContentStream (file:///Users/candowu/code/AIClient-2-API/src/providers/adapter.js:353:9)
at async handleStreamRequest (file:///Users/candowu/code/AIClient-2-API/src/utils/common.js:254:26)
at async handleContentGenerationRequest (file:///Users/candowu/code/AIClient-2-API/src/utils/common.js:678:9)
at async handleAPIRequests (file:///Users/candowu/code/AIClient-2-API/src/services/api-manager.js:52:13)
at async Server.requestHandler (file:///Users/candowu/code/AIClient-2-API/src/handlers/request-handler.js:232:32)
[Provider Pool] Marking claude-kiro-oauth as unhealthy due to stream error (status: unknown)
[ProviderPoolManager] Provider 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a for type claude-kiro-oauth error count: 1/3. Still healthy.
[Stream Retry] Credential marked unhealthy. Waiting 302ms before retry 1/5 with different credential...
[Adapter] getServiceAdapter, provider: claude-kiro-oauth, uuid: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Stream Retry] No different healthy credential available. Same credential selected.
2026/1/21 11:22:43
[Server] Received request: POST http://localhost:3000/claude-kiro-oauth/v1/messages?beta=true
[Config] MODEL_PROVIDER overridden by path segment to: claude-kiro-oauth
[API Service] Using pooled configuration for claude-kiro-oauth: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Adapter] getServiceAdapter, provider: claude-kiro-oauth, uuid: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Content Generation] Model: claude-sonnet-4-5, Stream: false
[Adapter] getServiceAdapter, provider: claude-kiro-oauth, uuid: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Content Generation] Re-selected service adapter based on model: claude-sonnet-4-5
[Request Convert] Request format matches backend provider. No conversion needed.
[Kiro] Calling generateContent with model: claude-sonnet-4-5
[Kiro] Ignoring tool: WebSearch
[Kiro] Truncated tool 'Bash' description: 9777 -> 9219 chars
[Kiro] Truncated tool 'TodoWrite' description: 9701 -> 9219 chars
[Kiro] Truncated 2 tool description(s) to max 9216 chars
[Kiro] Token calculation from contextUsagePercentage: total=136, output=21, input=115
[Provider Pool] Increasing usage count for claude-kiro-oauth (4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a) after successful stream request
[ProviderPoolManager] Marked provider as healthy: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a for type claude-kiro-oauth
[ProviderPoolManager] configs/provider_pools.json updated successfully for types: claude-kiro-oauth
[ProviderPoolManager] configs/provider_pools.json updated successfully for types: claude-kiro-oauth
[Kiro] API call failed (Status: 400, Code: ERR_BAD_REQUEST): Request failed with status code 400
[Server] Error during unary processing: AxiosError: Request failed with status code 400
at settle (file:///Users/candowu/code/AIClient-2-API/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (file:///Users/candowu/code/AIClient-2-API/node_modules/axios/lib/adapters/http.js:599:11)
at IncomingMessage.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1698:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
at Axios.request (file:///Users/candowu/code/AIClient-2-API/node_modules/axios/lib/core/Axios.js:45:41)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async KiroApiService.callApi (file:///Users/candowu/code/AIClient-2-API/src/providers/claude/claude-kiro.js:1320:30)
at async KiroApiService.generateContent (file:///Users/candowu/code/AIClient-2-API/src/providers/claude/claude-kiro.js:1615:26)
at async handleUnaryRequest (file:///Users/candowu/code/AIClient-2-API/src/utils/common.js:422:32)
at async handleContentGenerationRequest (file:///Users/candowu/code/AIClient-2-API/src/utils/common.js:680:9)
at async handleAPIRequests (file:///Users/candowu/code/AIClient-2-API/src/services/api-manager.js:52:13)
at async Server.requestHandler (file:///Users/candowu/code/AIClient-2-API/src/handlers/request-handler.js:232:32)
[Provider Pool] Marking claude-kiro-oauth as unhealthy due to unary error (status: 400)
[ProviderPoolManager] Provider 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a for type claude-kiro-oauth error count: 1/3. Still healthy.
[Unary Retry] Credential marked unhealthy. Waiting 8873ms before retry 1/5 with different credential...
[ProviderPoolManager] configs/provider_pools.json updated successfully for types: claude-kiro-oauth
[Adapter] getServiceAdapter, provider: claude-kiro-oauth, uuid: 4bf6cab3-5062-4b47-9ccf-a2baef3b7c2a
[Unary Retry] No different healthy credential available. Same credential selected.
[ProviderPoolManager] configs/provider_pools.json updated successfully for types: claude-kiro-oauth
[API Potluck] Running scheduled health sync from pool...
[API Potluck] Health sync complete: 0/0 healthy
[API Potluck] Running scheduled health sync from pool...
[API Potluck] Health sync complete: 0/0 healthy
[API Potluck] Running scheduled health sync from pool...
[API Potluck] Health sync complete: 0/0 healthy
[API Potluck] Running scheduled health sync from pool...
[API Potluck] Health sync complete: 0/0 healthy
@justlovemaki commented on GitHub (Jan 21, 2026):
Try using a different client, or downgrade the client version, or remove excessive MCPs, skills, and subagents.
@williamleecn commented on GitHub (Jan 21, 2026):
#270 #275