Repository navigation
fix(tools): include field details in beta tool argument errors - #2034
Open
vitorcomin33 wants to merge 1 commit into
Open
vitorcomin33 wants to merge 1 commit into
vitorcomin33 wants to merge 1 commit into
Conversation
chrikrah
reviewed
Oct 25, 2026
chrikrah
left a comment
There was a problem hiding this comment.
From my perspective this can be merged. Reverting _beta_functions.py fails your 8 new or changed non-snapshot tests, and a body ValidationError still matches except ValueError, its base class.
$ uv run pytest tests/lib/tools/test_functions.py tests/lib/tools/test_runners.py -n 0 -q
# head c3f8bf0, Python 3.10, pydantic 2.12.5
9 failed, 182 passed, 1 xfailed
# head with _beta_functions.py reverted to 202db72, tests kept
17 failed, 174 passed, 1 xfailed
# the 9 failing in both are http_snapshot runner tests, which need network here
non-blocking: a callable instance now gets a misleading NameError. functools.wraps copies no annotations, so pydantic resolves the wrapper's Any in the wrong module.
# exported trees, pydantic 2.12.5; class C: def __call__(self, a: int) -> str
$ uv run python inst.py # beta_tool(C(), name="c", description="d").call({"a": 1})
base 202db72: PydanticUserError Unable to validate <__main__.C object ...>: `validate_call` should be applied to functions, not ...
head c3f8bf0: NameError name 'Any' is not defined
A partial gets it too, so #1955's partial tests fail on top of this unless one is wrapped as partial(_wrap_body_validation_errors(p.func), *p.args, **p.keywords).
# head c3f8bf0 + #1955 d87ffc6, both test_functions.py files
$ uv run pytest <both> -n 0 -q -k partial
5 failed
# same, with that partial branch
$ uv run pytest <both> -n 0 -q
57 passed
@vitorcomin33 should only plain functions get the wrapper?
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.
No description provided.