Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
xuilen
force-pushed
the
fix/preserve-input-tool-schema
branch
from
November 27, 2026 04:09
b1dd0f0 to
c160a4f
Compare
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.
Why are these changes needed?
Passing a dictionary to
@tool(schema=...)removes its top-leveltitle:FunctionDefinition.__post_init__pops the key from the same dictionary supplied by the caller. Reusing that dictionary then loses its original metadata.Copy the parameter mapping before removing the top-level title. The generated tool schema still omits that title and retains nested property titles. A public-decorator regression test checks both the caller's original dictionary and the generated schema. The copy is shallow because this normalization changes only the top-level mapping.
Validation on Windows / Python 3.13.14:
uv run --no-sync --frozen pytest test/tools/test_naming.py test/tools/test_agent_tools.py test/tools/test_client_tool.py test/tools/test_execution.py test/tools/test_public_exports.py -q -p no:cacheprovider: 57 passed, 1 existing xfail.Tool.schemaattribute diagnostics; checking the unmodified main test file produces the same five messages. They are not suppressed by this PR.The full suite, live-provider calls, and other operating systems were not run. Remote CI has not run for this branch.
Related issue number
No existing issue; found by tracing the public
tool(schema=...)path on current main. Open PR titles and changed files were checked for overlap before preparing this fix.Checks
AI assistance
Codex assisted with source review, the patch, regression reproduction, local test execution, and this description. I reviewed the diff and recorded test evidence before authorizing submission; the reported commands were executed by Codex, not rerun personally. I take responsibility for the contribution and can discuss it with reviewers.