Commit de39b7a
committed
mcp(test[server]): guard _HANDLE_HINTS against tool-name drift
``_format_handles_section`` filters card hints by ``tool in
visible_tool_names`` — a tool name in ``_HANDLE_HINTS`` that no longer
matches a registered tool produces the worst of both worlds: agents
see a phantom tool name during the brief import-time placeholder
window (where ``visible_tool_names is None`` and every hint is
emitted unconditionally), then lose the guidance entirely once
``run_server`` filters by real visibility.
Phase 1's ``test_tool_description_includes`` already catches drift in
tool descriptions. This test catches drift in the parallel
``_HANDLE_HINTS`` table — the two together close the rename-without-
update loophole.
Pure addition; no source changes.1 parent 883cd80 commit de39b7a
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
282 | 314 | | |
283 | 315 | | |
284 | 316 | | |
| |||
0 commit comments