mirror of
https://github.com/jwadow/kiro-gateway.git
synced 2026-04-25 01:15:57 +03:00
[PR #82] fix(models): sanitize unknown content block types to prevent 422 errors #79
Labels
No labels
bug
bug
enhancement
enhancement
fixed
fixed
invalid
needs-info
needs-testing
pull-request
question
upstream
wontfix
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/kiro-gateway-jwadow#79
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?
📋 Pull Request Information
Original PR: https://github.com/jwadow/kiro-gateway/pull/82
Author: @XuNeo
Created: 2/22/2026
Status: 🔄 Open
Base:
main← Head:fix/sanitize-unknown-content-blocks📝 Commits (2)
459be05feat(config): add claude-opus-4.6 to fallback modelsa6f95c4fix(models): sanitize unknown content block types to prevent 422 errors📊 Changes
2 files changed (+56 additions, -1 deletions)
View changed files
📝
kiro/config.py(+1 -0)📝
kiro/models_anthropic.py(+55 -1)📄 Description
Summary
ToolSearch(deferred tool loading) returnstool_referencecontent blocks insidetool_resultmessages. These are an internal Claude Code content type not recognized by the Anthropic Messages API schema.model_validator(mode="before")toToolResultContentBlockandAnthropicMessagethat converts unrecognized block types (e.g.tool_reference) into harmless text blocks before Pydantic validation runs.Example
Before (causes 422):
After (passes validation):
Test plan
ToolSearchto load deferred MCP tools — no more 422 errors🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.