---
type: email
from: Zach Birenbaum <notifications@github.com>
subject: Re: [openai/openai-agents-python] Fix streaming trace end before

 guardrails complete (PR #1921)
received: 2026-03-06 08:07:29
date_header: Fri, 17 Oct 2025 15:44:14 -0700
priority: normal
status: awaiting_approval
uid: 32867
---

## Email Content

**From:** Zach Birenbaum <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] Fix streaming trace end before

 guardrails complete (PR #1921)
**Date:** Fri, 17 Oct 2025 15:44:14 -0700

### Body (preview)

@zbirenbaum commented on this pull request.







> @@ -1138,6 +1138,12 @@ async def _start_streaming(

 

             streamed_result.is_complete = True

         finally:

+            if streamed_result._input_guardrails_task:

+                try:

+                    streamed_result.input_guardrail_results = await streamed_result._input_guardrails_task

+                except Exception:

+                    # Exceptions will be checked in the stream_events loop

+                    output_guardrail_results = []



I'm definitely open to taking some time to ensure it works as intended, I am a little limited on time today so may need to followup tomorrow or Monday if that's alright.



I already have a repro file I can use to test the before and after behavior so shouldn't be hard. I'll take a look at the unit tests and see if I can add a few for the relevant scenarios



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1921#discussion_r2441403430

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/pull/1921/review/3352314883@github.com>

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
