Commit d0bcec9
fix: TransformedTool sync fn crash and schema mutation (#3823)
* fix: TransformedTool sync fn crash, schema mutation, output_schema=False
- Handle sync transform_fn in run() using is_coroutine_function check
instead of unconditionally awaiting (fixes TypeError crash)
- Deep copy parent property schemas to prevent mutation corruption
- Accept output_schema=False via BeforeValidator (converts to None)
- Remove inaccurate docstring claiming str/None shorthand for transform_args
Fixes #3821
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add regression tests for sync transform_fn and schema mutation
🤖 Generated with Claude Code
Co-authored-by: Jeremiah Lowin <jeremiah@lowin.dev>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jeremiah@lowin.dev>1 parent 790f0bc commit d0bcec9
2 files changed
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
310 | 314 | | |
311 | 315 | | |
312 | 316 | | |
313 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
314 | 323 | | |
315 | 324 | | |
316 | 325 | | |
| |||
385 | 394 | | |
386 | 395 | | |
387 | 396 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 397 | + | |
| 398 | + | |
392 | 399 | | |
393 | 400 | | |
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
397 | 404 | | |
398 | | - | |
399 | 405 | | |
400 | 406 | | |
401 | 407 | | |
| |||
629 | 635 | | |
630 | 636 | | |
631 | 637 | | |
632 | | - | |
| 638 | + | |
633 | 639 | | |
634 | | - | |
| 640 | + | |
635 | 641 | | |
636 | 642 | | |
637 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
0 commit comments