Commit adbf51c
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 adbf51c
2 files changed
Lines changed: 32 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
592 | 597 | | |
593 | | - | |
| 598 | + | |
| 599 | + | |
594 | 600 | | |
595 | 601 | | |
596 | | - | |
| 602 | + | |
| 603 | + | |
597 | 604 | | |
598 | 605 | | |
599 | 606 | | |
600 | 607 | | |
601 | | - | |
| 608 | + | |
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
605 | 612 | | |
606 | | - | |
607 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
608 | 618 | | |
609 | | - | |
610 | | - | |
| 619 | + | |
611 | 620 | | |
612 | 621 | | |
613 | 622 | | |
| |||
649 | 658 | | |
650 | 659 | | |
651 | 660 | | |
652 | | - | |
| 661 | + | |
653 | 662 | | |
654 | 663 | | |
655 | 664 | | |
| |||
| 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