Commit 3e5eb89
fix: preserve tool results in context on cancellation
When user presses Ctrl+C during tool execution, tool results that already
completed must be saved to context. Otherwise, the next LLM request fails
with 'tool_use ids were found without tool_result blocks' errors from
providers like Anthropic.
After asyncio.gather() completes with tool results, we now add them to
context BEFORE returning on cancellation (previously skipped this step).
🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>1 parent 0b9d040 commit 3e5eb89
1 file changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | | - | |
359 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
360 | 370 | | |
361 | 371 | | |
362 | 372 | | |
| |||
0 commit comments