Skip to content

OpenAIRealtimeLLMService: response_cancel_not_active error fatally kills WebSocket #3755

@eoinoreilly30

Description

@eoinoreilly30

pipecat version

0.0.98

Python version

3.12

Operating System

macOS (darwin 25.2.0)

Issue description

When using OpenAIRealtimeLLMService with turn_detection=False for push-to-talk, sending an InterruptionFrame when the bot is not actively responding causes a fatal WebSocket disconnection.

When you send a ResponseCancelEvent, the OpenAI API returns a response_cancel_not_active error, and _receive_task_handler treats all unhandled errors as fatal — exiting the receive loop and tearing down the connection. response_cancel_not_active should not be a fatal error.

Reproduction steps

  1. Configure OpenAIRealtimeLLMService with turn_detection=False in AudioInput
  2. Start a conversation and let the bot finish its initial response
  3. Send an InterruptionFrame
  4. The InterruptionFrame triggers _handle_interruption() which sends ResponseCancelEvent even though no response is active

Expected behavior

The response_cancel_not_active error should be treated as non-fatal. The WebSocket connection should remain open and the conversation should continue normally.

Actual behavior

The receive loop in _receive_task_handler treats the error as fatal, exits the loop, and the WebSocket connection is destroyed.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions