Repository navigation
Commit c998563
fix(git): report unknown tools and flag-injection rejections as written
call_tool read arguments["repo_path"] before dispatching on the tool
name, so an unknown tool called without repo_path failed with the
KeyError repr "'repo_path'". It now rejects an unknown name first, with
"Unknown tool: <name>" (modelcontextprotocol#4994).
The flag-injection guards raised BadName, whose __str__ wraps its
argument as a ref name, so the guard's message reached the client as
"Ref '<message>' did not resolve to an object". They now raise
FlagInjectionError, a BadName subclass that reports its message as
written; the rejection itself, and the BadName type test_server.py
asserts, are unchanged (modelcontextprotocol#4999).
The pinning tests in test_protocol.py now assert the correct messages,
and their KNOWN BUG markers are gone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>1 parent 571e2b3 commit c998563
2 files changed
Lines changed: 44 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
20 | 32 | | |
21 | 33 | | |
22 | 34 | | |
| |||
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
138 | | - | |
| 150 | + | |
139 | 151 | | |
140 | 152 | | |
141 | 153 | | |
| |||
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
214 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
215 | 229 | | |
216 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
217 | 233 | | |
218 | 234 | | |
219 | 235 | | |
| |||
227 | 243 | | |
228 | 244 | | |
229 | 245 | | |
230 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
231 | 249 | | |
232 | 250 | | |
233 | 251 | | |
| |||
239 | 257 | | |
240 | 258 | | |
241 | 259 | | |
242 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
243 | 263 | | |
244 | 264 | | |
245 | 265 | | |
| |||
292 | 312 | | |
293 | 313 | | |
294 | 314 | | |
295 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
296 | 318 | | |
297 | | - | |
| 319 | + | |
298 | 320 | | |
299 | 321 | | |
300 | 322 | | |
| |||
478 | 500 | | |
479 | 501 | | |
480 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
481 | 508 | | |
482 | 509 | | |
483 | 510 | | |
| |||
562 | 589 | | |
563 | 590 | | |
564 | 591 | | |
565 | | - | |
| 592 | + | |
| 593 | + | |
566 | 594 | | |
567 | 595 | | |
568 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 43 | + | |
| 44 | + | |
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
| |||
115 | 110 | | |
116 | 111 | | |
117 | 112 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
123 | 119 | | |
124 | 120 | | |
125 | 121 | | |
| |||
270 | 266 | | |
271 | 267 | | |
272 | 268 | | |
273 | | - | |
274 | 269 | | |
275 | 270 | | |
276 | 271 | | |
| |||
632 | 627 | | |
633 | 628 | | |
634 | 629 | | |
635 | | - | |
636 | 630 | | |
637 | 631 | | |
638 | 632 | | |
| |||
692 | 686 | | |
693 | 687 | | |
694 | 688 | | |
695 | | - | |
696 | 689 | | |
697 | 690 | | |
698 | 691 | | |
| |||
826 | 819 | | |
827 | 820 | | |
828 | 821 | | |
829 | | - | |
830 | 822 | | |
831 | 823 | | |
832 | 824 | | |
| |||
895 | 887 | | |
896 | 888 | | |
897 | 889 | | |
898 | | - | |
899 | 890 | | |
900 | 891 | | |
901 | 892 | | |
| |||
0 commit comments