Commit eb2e713
fix: handle CancelledError for immediate cancellation during tool execution
When asyncio.gather() is cancelled mid-execution (second Ctrl+C), synthesize
'cancelled' tool results for all tool_calls before re-raising the exception.
This maintains the required tool_use/tool_result pairing in the conversation
context, preventing API errors from orphaned tool calls.
🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>1 parent 3e5eb89 commit eb2e713
1 file changed
+21
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | | - | |
354 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
355 | 372 | | |
356 | | - | |
| 373 | + | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
| |||
0 commit comments