Fix transform arg collisions with passthrough params (#3431)

🤖 Generated with GPT-5.2-Codex
This commit is contained in:
Jeremiah Lowin 2026-03-07 11:41:07 -05:00 committed by GitHub
commit d316f193a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 6 deletions

View file

@ -482,6 +482,20 @@ def test_transform_args_creates_duplicate_names(add_tool):
)
def test_transform_args_collision_with_passthrough_name(add_tool):
"""Test that renaming to a passthrough parameter name raises ValueError."""
with pytest.raises(
ValueError,
match="Multiple arguments would be mapped to the same names: old_y",
):
Tool.from_tool(
add_tool,
transform_args={
"old_x": ArgTransform(name="old_y"),
},
)
def test_function_without_kwargs_missing_params(add_tool):
"""Test that function missing required transformed parameters raises ValueError."""