-
-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Description
When using Claude Code with a proxy that routes requests to Kiro/Amazon Q API backend, the WebSearch feature fails with a 400 Improperly formed request error.
Root Cause
Claude Code sends a built-in web search tool with a special format:
{"type":"web_search_20250305","name":"web_search","max_uses":8}
This is different from standard user-defined tools which have name, description, and input_schema fields. The Kiro API does not recognize this special tool format and rejects the request.
Steps to Reproduce
Configure Claude Code to use a proxy with Kiro/Amazon Q backend
Start a conversation that triggers WebSearch (e.g., ask about current events)
Observe the 400 error in logs:
kiro: received 400 error, body: {"message":"Improperly formed request.","reason":null}
Expected Behavior
WebSearch should either:
Be converted to a format Kiro API understands, or
Be gracefully skipped with the request proceeding without web search capability
Actual Behavior
The entire request fails with HTTP 400 error, blocking the conversation.
Workaround
Skip the web_search_20250305 tool type in the request translation layer:
if toolType == "web_search_20250305" {
log.Debugf("kiro: skipping Claude built-in web_search tool (type=%s)", toolType)
continue
}