After #1968 added force_response_cancel=True, the guardrail interrupt itself works, but there's still a gap between the cancel and the follow-up.
In _run_output_guardrails (session.py L956-964), after sending RealtimeModelSendInterrupt(force_response_cancel=True), the code immediately sends RealtimeModelSendUserInput with the guardrail message. That user input ends up calling response.create through openai_realtime.py L472-475. If the server hasn't finished processing the cancel yet (i.e. response.done hasn't come back), you get:
Conversation already has an active response in progress: resp_...
I ran into this while testing with turn_detection.interrupt_response enabled on a setup with some network latency. Same error that #1907 originally reported — a commenter on #1912 (2025-10-23) also hit it after upgrading to 0.4.1.
What's happening
_run_output_guardrails
→ send_event(RealtimeModelSendInterrupt(force_response_cancel=True)) # sends response.cancel
→ send_event(RealtimeModelSendUserInput(...)) # sends response.create
^ nothing waits for response.done in between
Debug information
- Agents SDK version: 0.13.0
- Python version: 3.12
Expected behavior
Wait for response.done for the interrupted response before sending the follow-up input.
After #1968 added
force_response_cancel=True, the guardrail interrupt itself works, but there's still a gap between the cancel and the follow-up.In
_run_output_guardrails(session.py L956-964), after sendingRealtimeModelSendInterrupt(force_response_cancel=True), the code immediately sendsRealtimeModelSendUserInputwith the guardrail message. That user input ends up callingresponse.createthroughopenai_realtime.pyL472-475. If the server hasn't finished processing the cancel yet (i.e.response.donehasn't come back), you get:I ran into this while testing with
turn_detection.interrupt_responseenabled on a setup with some network latency. Same error that #1907 originally reported — a commenter on #1912 (2025-10-23) also hit it after upgrading to 0.4.1.What's happening
Debug information
Expected behavior
Wait for
response.donefor the interrupted response before sending the follow-up input.