Skip to content

Commit a33facf

Browse files
committed
fix: add queue sentinel before raising blocking guardrail exception in streaming
1 parent 4bcf66d commit a33facf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/agents/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ async def _start_streaming(
10971097
# Check if any blocking guardrail triggered and raise before starting agent.
10981098
for result in streamed_result.input_guardrail_results:
10991099
if result.output.tripwire_triggered:
1100+
streamed_result._event_queue.put_nowait(QueueCompleteSentinel())
11001101
raise InputGuardrailTripwireTriggered(result)
11011102

11021103
# Run parallel guardrails in background.

0 commit comments

Comments
 (0)