Repository navigation
Conversation
This branch has not been deployed
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.
Change Summary
coerce_arguments()supports widening Python integers to floats when a tool declaresnumberwithoutinteger. However, when the number is inside an object or array, the outer equality check discards the converted structure: Python considers[3] == [3.0]. This makes the same tool argument behave differently at the top level and when nested.Preserve container identity when recursive coercion makes no changes, and use identity to propagate actual conversions. Do not mutate the caller's input. The existing numeric unions, boolean exclusions, and unchanged-argument identity behavior remain intact.
The dispatch regression runs the real
ToolManager.single_call_tool()against a local tool using Pydantic v1StrictFloat: before the fix, the nested argument fails validation; after it, the call succeeds. This is a strict Python validator compatibility issue, not a claim that JSON Schema rejects integers fornumber.Related issue number
No linked issue. Checked current open issues, discussion comments, all 43 open PR file lists (including the second page for #1002), and the 100 most recently updated closed PRs. No competing nested argument-coercion fix found. This change is separate from the open memory, cron, rate-limiter, and tool-permission changes.
Validation
Base:
6d90d84e55d508fcb52ea19f3912de6f6a477e38, Python 3.12.git diff --check: passed.Reproduction commands
Checklist
pre-commit installandpre-commit run --all-filesbefore git commit, and passed lint check