Skip to content

[Bug]: Bedrock Nova Sonic realtime leaks barge-in marker { "interrupted" : true } as literal response.text.delta content #38253

Description

@MarshHawk

[Bug]: Bedrock Nova Sonic realtime leaks barge-in marker { "interrupted" : true } as literal response.text.delta content

What happened?

When a user interrupts (barge-in) during a Bedrock Nova Sonic realtime session via the proxy WebSocket (/v1/realtime?model=bedrock/amazon.nova-2-sonic-v1:0), Nova Sonic emits a textOutput event whose content is the literal JSON marker:

{ "interrupted" : true }

BedrockRealtimeTransformation.transform_text_output_event (litellm/llms/bedrock/realtime/transformation.py) passes textOutput content through verbatim into response.text.delta, so clients receive the marker as if it were model-generated text, interleaved with real response text:

okay here is the answer{ "interrupted" : true }okay here is the answer...

(Interrupted responses then restart from the beginning, so clients also see duplicated text — see companion issue about user-transcription/role handling.)

Expected behavior

The marker should be translated to OpenAI Realtime interruption semantics (e.g. cancel/truncate the in-progress response, or emit interruption signaling) — or at minimum be filtered out of response.text.delta content, since it is a Nova Sonic protocol control marker, not model output.

Steps to Reproduce

  1. Register bedrock/amazon.nova-2-sonic-v1:0 on the proxy with model_info.mode: realtime.
  2. Connect to ws://proxy/v1/realtime?model=<alias>, send session.update with instructions, stream mic audio (input_audio_buffer.append, PCM16 16 kHz).
  3. Speak, then interrupt the model while it is responding.
  4. Observe response.text.delta events containing the literal { "interrupted" : true } string.

LiteLLM version

v1.98.0 (proxy)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions