Skip to content

fix: nest endpointingSensitivity under endpointing in sessionStart#6248

Open
C1-BA-B1-F3 wants to merge 1 commit into
livekit:mainfrom
C1-BA-B1-F3:main
Open

fix: nest endpointingSensitivity under endpointing in sessionStart#6248
C1-BA-B1-F3 wants to merge 1 commit into
livekit:mainfrom
C1-BA-B1-F3:main

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown

Problem

When starting a Nova Sonic 2 session, the sessionStart event is rejected by the API because endpointingSensitivity is placed at the top level of sessionStart. The Nova Sonic 2 API expects it nested under an endpointing key.

Fix

  • Added Endpointing Pydantic model with the endpointingSensitivity field
  • Updated SessionStart model to use endpointing: Endpointing instead of endpointingSensitivity at the top level
  • Updated SonicEventBuilder.create_session_start_event() to construct the nested structure

Before (rejected)

{
  "sessionStart": {
    "inferenceConfiguration": {...},
    "endpointingSensitivity": "MEDIUM"
  }
}

After (correct)

{
  "sessionStart": {
    "inferenceConfiguration": {...},
    "endpointing": {
      "endpointingSensitivity": "MEDIUM"
    }
  }
}

Fixes #6200

Nova Sonic 2 API rejects sessionStart when endpointingSensitivity is
placed at the top level. It must be nested under an 'endpointing' key.

Fixes livekit#6200

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@C1-BA-B1-F3 C1-BA-B1-F3 requested a review from a team as a code owner June 26, 2026 14:31

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +98 to +104
class Endpointing(BaseModel):
endpointingSensitivity: TURN_DETECTION | None = "MEDIUM"


class SessionStart(BaseModel):
inferenceConfiguration: InferenceConfiguration
endpointingSensitivity: TURN_DETECTION | None = "MEDIUM"
endpointing: Endpointing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Schema change is a breaking wire-format change for the AWS API

This PR changes the serialized JSON structure sent to the AWS Nova Sonic API. Previously the session start event contained "endpointingSensitivity": "MEDIUM" at the top level of sessionStart. Now it emits "endpointing": {"endpointingSensitivity": "MEDIUM"}. This is a breaking wire-format change β€” if the AWS API has not been updated to accept this new schema, sessions will fail to start. Since this is an external API contract, correctness cannot be verified from the codebase alone.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nova Sonic 2 sessionStart rejected: endpointingSensitivity must be nested under turnDetectionConfiguration

1 participant