Commit 4e65991
committed
fix: remove dead code path in _handle_call_tool and correct call_tool return type
The isinstance(result, dict) branch in _handle_call_tool is unreachable
because FuncMetadata.convert_result never returns a raw dict -- it returns
CallToolResult, Sequence[ContentBlock], or a tuple of
(Sequence[ContentBlock], dict[str, Any]).
This change:
- Removes the dead dict branch
- Drops the now-unused import json
- Corrects call_tool's return type annotation to reflect the actual
return shapes
Closes #2695
Co-authored-by: AI assistant (code review and diff structuring)
Signed-off-by: Wahaj Ahmed <wahaj.ahmed010@gmail.com>1 parent cf110e3 commit 4e65991
1 file changed
Lines changed: 1 addition & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
322 | 321 | | |
323 | 322 | | |
324 | 323 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | 324 | | |
334 | 325 | | |
335 | 326 | | |
| |||
399 | 390 | | |
400 | 391 | | |
401 | 392 | | |
402 | | - | |
| 393 | + | |
403 | 394 | | |
404 | 395 | | |
405 | 396 | | |
| |||
0 commit comments