Commit e56525a
Remove dead dict branch in _handle_call_tool and fix call_tool return type
`FuncMetadata.convert_result` only ever returns one of three shapes:
a `CallToolResult`, a `Sequence[ContentBlock]`, or a
`(unstructured_content, structured_content)` tuple. It never returns a
raw `dict`, so the `isinstance(result, dict)` branch in
`_handle_call_tool` was unreachable (already marked `# pragma: no cover`
with a TODO).
Remove the dead branch, correct `call_tool`'s return annotation to
reflect the three real shapes, and drop the now-orphaned `json` import
(used only inside the removed branch).
Closes #2695
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent cf110e3 commit e56525a
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