Commit 39985e5
fix: walk MRO for tool filtering, add tool name validation
- get_tools_for_handler now accepts instance or class, walks MRO to find
the matching handler base class. Fixes filtering for user subclasses
(e.g. MyGovernanceAgent(GovernanceHandler) now correctly gets only
governance tools).
- Add module-level assertion that all tool names in _HANDLER_TOOLS
reference real tools in ADCP_TOOL_DEFINITIONS.
- Add test for subclass MRO-based filtering.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 12f1080 commit 39985e5
2 files changed
+33
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
| |||
589 | 585 | | |
590 | 586 | | |
591 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
592 | 594 | | |
593 | | - | |
| 595 | + | |
594 | 596 | | |
595 | 597 | | |
596 | | - | |
| 598 | + | |
| 599 | + | |
597 | 600 | | |
598 | 601 | | |
599 | 602 | | |
600 | 603 | | |
601 | | - | |
| 604 | + | |
602 | 605 | | |
603 | 606 | | |
604 | 607 | | |
605 | 608 | | |
606 | | - | |
607 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
608 | 614 | | |
609 | | - | |
610 | | - | |
| 615 | + | |
611 | 616 | | |
612 | 617 | | |
613 | 618 | | |
| |||
649 | 654 | | |
650 | 655 | | |
651 | 656 | | |
652 | | - | |
| 657 | + | |
653 | 658 | | |
654 | 659 | | |
655 | 660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | | - | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
100 | | - | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | | - | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| |||
0 commit comments