Skip to content

google(realtime): commitAudio()/clearAudio() are no-ops, so manual activity detection cannot close a user turn #2581

Description

@pivvix

Version: @livekit/agents-plugin-google@1.9.0, @livekit/agents@1.9.0; also present on main.

With realtimeInputConfig.automaticActivityDetection.disabled = true, RealtimeModel.capabilities.turnDetection becomes false, and AgentActivity.userTurnCompleted() correctly routes end-of-turn to realtimeSession.commitAudio() (agents/src/voice/agent_activity.ts:2966). In the Google plugin both methods are empty (plugins/google/src/realtime/realtime_api.ts:1932-1934), so nothing is sent to the server.

async commitAudio() {}

async clearAudio() {}

activityEnd is emitted only from inside generateReply(). The consequence is that an application using local VAD can open a user turn via startUserActivity() but has no supported way to close one, except by also requesting a generation — which on placeholder models injects a synthetic {role:"user", text:"."} turn.

Downstream effect: candidate input transcripts flush in markCurrentGenerationDone(), so with no generation there is no final transcript, and an application-owned turn state machine cannot function.

Expected: commitAudio() sends { realtime_input: { activityEnd: {} } } when manualActivityDetection is true (and clears inUserActivity); clearAudio() has a corresponding behaviour or is documented as unsupported for this provider.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions