Skip to content

Websocket RealtimeAgent crashes with "Invalid type for 'audio_end_ms': expected an integer, but got a decimal number instead." when speed is set to 1.1 #552

@AlexandreBjuSelectra

Description

@AlexandreBjuSelectra

Describe the bug

Setting the RealtimeAgent to a speed of 1.1 is resulting in a crash almost instantly after the agent picked up, here is the log

Error: Unhandled error. ({
  type: 'error',
  error: {
    type: 'error',
    event_id: 'event_CLtCIVUMD1pZuITLlPJRS',
    error: {
      type: 'invalid_request_error',
      code: 'invalid_type',
      message: "Invalid type for 'audio_end_ms': expected an integer, but got a decimal number instead.",
      param: 'audio_end_ms',
      event_id: null
    }
  }
})

This bug is the same than the one describe in this issue but this time for 'websocket' transport: Related issue for Twilio RealtimeAgent.

Debug information

  • Agents SDK version: (e.g. v0.1.7)
  • Runtime environment (e.g. Node.js 22.20.0)

Repro steps

Config

const session = new RealtimeSession(agent, {
      transport: 'websocket',
      config: {
        speed: 1.1,
      },
    });

Expected behavior

That it does not throw this error :)

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