Expanded InjectAgentMessage features & new Latency reporting

InjectAgentMessage: behavior field and new interrupt mode

The InjectAgentMessage message now accepts a behavior field that controls how an injected message interacts with any in-progress user or agent turn. The default and queue behaviors were previously documented; the new interrupt behavior is introduced with this release.

  • default — the agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with InjectionRefused. This matches the original InjectAgentMessage behavior.
  • queue — the server appends the message after any ConversationText that is already queued, without interrupting the current agent turn or the in-flight think response. If nothing is queued, the agent speaks immediately.
  • interrupt (new) — the agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user’s continued speech triggers UserStartedSpeaking, which quickly interrupts the agent so the conversation keeps moving forward.

behavior is optional and defaults to default, so existing integrations are unaffected.

1{
2 "type": "InjectAgentMessage",
3 "behavior": "interrupt",
4 "message": "Sorry to cut in — let me correct that."
5}

For details, see the Inject Agent documentation.

Latency reporting

LatencyReport provides a detailed latency breakdown across the STT → LLM → TTS pipeline for each turn, including stt_latency, ttt_token_latency, ttt_text_latency, ttt_tool_latency, ttt_thinking_latency, tts_latency, and total_latency.

The LatencyReport server event had previously been available as an experimental feature – it is now fully supported and emitted automatically and no longer requires experimental: true.

1{
2 "type": "LatencyReport",
3 "stt_latency": 0.12,
4 "ttt_token_latency": 0.34,
5 "tts_latency": 0.18,
6 "total_latency": 0.64
7}

For details, see the Latency Report documentation.