Keep tool parameters named title in generated input_schema, closes #1679 - #1680
Merged
Merged
Conversation
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.
Fixes:
A tool function with a parameter named
titlehad that parameter deleted from the generatedinput_schemapropertieswhilerequiredstill listed it. Schema-strict models then omit the argument and the call fails withTypeError: ... missing 1 required positional argument: 'title'.Tatsuhiko Miyagawa reported this on llm 0.26 and 0.35 and traced it to
_remove_titles_recursively(), which is meant to strip Pydantic's"title": "When"annotations. Recursion intoproperties(and$defs) treated a property namedtitleas that keyword and deleted the whole field. The same tool had been working on models that were willing to go off-schema; it broke ongpt-5.6-luna.The helper now pops
titleonly when the value is a string, which is what JSON Schema'stitlekeyword is. A property or$defsentry namedtitlehas an object value, so it is kept. Pydantic annotations on sibling fields are still removed.I chose the string-value check rather than skipping
properties/$defsname-maps (the other fix suggested on the issue) or popping only when the dict also hastype/anyOf. The string check is one condition, matches the spec, and covers nested models without a keyword list. Happy to switch to the name-map walker if preferred.