You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: protect result-writing loops from CancelledError and catch CancelledError in tool execution
Harden the orchestrator's result-writing and tool-execution loops against
CancelledError to prevent orphaned tool_calls that break the conversation
state.
When a CancelledError escapes a result-writing loop, the assistant message
is committed without the corresponding tool result. The LLM sees a
tool_use without a tool_result on the next turn, causing a protocol
violation or infinite retry loop.
This fix catches CancelledError at two levels:
- In the result-writing loop, ensuring partial results are committed
- In tool execution, ensuring the tool result is always recorded
Rebased on main to pick up the defensive getattr access pattern for
tool call attributes.
Companion fixes already merged in loop-streaming#14 and loop-events#5.
Fixes: microsoft-amplifier/amplifier-support#46
🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
0 commit comments