Skip to content

Commit 5b449b3

Browse files
committed
run - raise on exception only
1 parent b693903 commit 5b449b3

File tree

1 file changed

+3
-2
lines changed
  • src/strands/experimental/bidi/agent

1 file changed

+3
-2
lines changed

src/strands/experimental/bidi/agent/agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ async def run_outputs(inputs_task: asyncio.Task) -> None:
395395

396396
try:
397397
await asyncio.gather(inputs_task, outputs_task)
398-
except (Exception, asyncio.CancelledError):
398+
except (Exception, asyncio.CancelledError) as error:
399399
inputs_task.cancel()
400400
outputs_task.cancel()
401401
await asyncio.gather(inputs_task, outputs_task, return_exceptions=True)
402-
raise
402+
if not isinstance(error, asyncio.CancelledError):
403+
raise
403404

404405
finally:
405406
input_stops = [input_.stop for input_ in inputs if isinstance(input_, BidiInput)]

0 commit comments

Comments
 (0)