fix: preserve 'type' field in TaskGroup JSON schema enum items#5073
Open
weiguangli-io wants to merge 1 commit intolivekit:mainfrom
Open
fix: preserve 'type' field in TaskGroup JSON schema enum items#5073weiguangli-io wants to merge 1 commit intolivekit:mainfrom
weiguangli-io wants to merge 1 commit intolivekit:mainfrom
Conversation
…it#5044) The json_schema_extra override for the out_of_scope tool's task_ids parameter was missing "type": "string" in the items sub-schema, causing Gemini API to reject the schema with a 400 INVALID_ARGUMENT error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 #5044 — The
json_schema_extraoverride intask_group.py(line 173) replaces theitemssub-schema entirely, dropping"type": "string". This causes Gemini API to reject the schema with a 400INVALID_ARGUMENTerror since it requires explicittypeon every schema node."type": "string"alongside"enum"in theitemssub-schema_GeminiJsonSchema._simplify()) has a downstream workaround that inferstypefrom enum values, so this may not reproduce on 1.4.x with the Google plugin (per @davidzhao's question) — but the source schema should still be correcttypeTest plan
out_of_scopetool includes{"type": "array", "items": {"type": "string", "enum": [...]}}🤖 Generated with Claude Code