fix(converters): resolve top-level oneOf/allOf/anyOf in tool schemas - #232
Open
xy69 wants to merge 1 commit into
Open
fix(converters): resolve top-level oneOf/allOf/anyOf in tool schemas#232xy69 wants to merge 1 commit into
xy69 wants to merge 1 commit into
Conversation
Bedrock rejects tool input_schema containing oneOf, allOf, or anyOf at the top level (TOOL_SCHEMA_INVALID). This resolves them before sending: - anyOf/oneOf: picks the first object-type variant - allOf: merges all variants into a single schema Nested composition keywords are preserved since Bedrock only rejects them at the root of input_schema.
|
Thanks for the PR! 🎉 Before merge, we need a one-time CLA confirmation. Full CLA text: Please reply once with: You need to write once, all further messages from me can be ignored. |
Author
|
I have read the CLA and I accept its terms |
|
@xy69 could you give a try to this gateway: https://github.com/ankitcharolia/kiro-gateway It works quite well with All AI harness and actively being developed. The most important thing is that it is ACP compliant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Bedrock
TOOL_SCHEMA_INVALIDerror when tools haveoneOf,allOf, oranyOfat the top level of theirinput_schema.Problem
OpenCode (and potentially other clients) send tools whose input schemas use JSON Schema composition keywords at the root level. Bedrock rejects these with:
Solution
Added
_resolve_top_level_composition()that flattens these before sending to Kiro:Nested composition keywords are preserved — Bedrock only rejects them at the root.
Testing
TestSanitizeJsonSchematests pass