File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -679,6 +679,9 @@ async def _run(prep: _PreparedToolCall) -> _FinalizedOutcome:
679679 except asyncio .CancelledError :
680680 raise
681681 except Exception :
682+ # Salvage is best-effort by contract: a failure while emitting
683+ # already-completed results must never mask the CancelledError
684+ # being re-raised below (mirrors _complete_cancelled_tool_calls).
682685 pass
683686 raise
684687
@@ -743,6 +746,9 @@ async def _run(prep: _PreparedToolCall) -> _FinalizedOutcome:
743746 try :
744747 await _emit_tool_result_messages (finalized_list , emit_fn )
745748 except Exception :
749+ # Best-effort: sibling persistence must never swallow the
750+ # control exception — the suspend/abort machinery depends on
751+ # it propagating; unanswered ids are backfilled on resume.
746752 pass
747753 raise control_exc
748754
You can’t perform that action at this time.
0 commit comments