Skip to content

Realtime guardrails: "Conversation already has an active response in progress" error #1907

@nbondoux

Description

@nbondoux

Within a realtime session, created with the turn_detection.interrupt_response set, the guardrail triggering fails and emit the following error event:

RealtimeErrorEvent(error=RealtimeError(message='Conversation already has an active response in progress: .... Wait until the response is finished before creating a new one.', type='invalid_request_error', code='conversation_already_has_active_response', event_id=None, param=None), event_id='event...', type='error')

My guess is that no response.cancel server event is sent during the interruption triggered by the guardrail, while it should always be.

In OpenAIRealtimeWebSocketModel._send_interrupt, response.cancel is triggered if turn_detection.interrupt_response is not set, and the guardrail process flow doesn't trigger a response.cancel event on its side.

Debug information

  • Agents SDK version: 0.3.2
  • Python version: Python 3.13

Repro steps

create an agent without setting a PlaybackTracker, and with turn_detection.interrupt_response set. Trigger a any guardrail.

Expected behavior

Guardrail interrupts and successfully send user input to the model with the tripped guardrail data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions