Commit 02a4300
committed
[bugf][agent][tools=[] enables the deferred-tool machinery it has nothing to search]
exists() is 'is not None', so exists([]) is True and an empty tools list
counted as having tools. An agent built with tools=[] was given the
tool_search schema and DYNAMIC_TOOLS_NOTICE in its system prompt, then
advertised a tool whose catalog is empty on every request.
tools=None produced the correct empty result, so the two spellings of 'no
tools' behaved differently. CLAUDE.md documented the difference as a footgun
to avoid; the warning goes away with the cause.
Truthiness at the two call sites. mcp_enabled and max_loops='auto' still
enable deferral on their own, so an autonomous agent with no tools keeps the
loader it needs.1 parent 8b7b80c commit 02a4300
3 files changed
Lines changed: 49 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | | - | |
1090 | | - | |
1091 | 1089 | | |
1092 | 1090 | | |
1093 | 1091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
679 | 682 | | |
680 | | - | |
| 683 | + | |
681 | 684 | | |
682 | 685 | | |
683 | 686 | | |
| |||
686 | 689 | | |
687 | 690 | | |
688 | 691 | | |
689 | | - | |
| 692 | + | |
690 | 693 | | |
691 | 694 | | |
692 | 695 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3311 | 3311 | | |
3312 | 3312 | | |
3313 | 3313 | | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
3314 | 3358 | | |
3315 | 3359 | | |
3316 | 3360 | | |
| |||
0 commit comments