Skip to content

fix(voice): preserve tool responses on early exits - #2260

Open
swayamg20 wants to merge 2 commits into
livekit:mainfrom
swayamg20:fix/2249-preserve-tool-responses
Open

fix(voice): preserve tool responses on early exits#2260
swayamg20 wants to merge 2 commits into
livekit:mainfrom
swayamg20:fix/2249-preserve-tool-responses

Conversation

@swayamg20

Copy link
Copy Markdown

Summary

  • return an error function response when a model emits a tool call while toolChoice is set to none, without executing the tool
  • commit completed regular tool outputs and flush them to the realtime provider before interrupted generations exit, so pending call IDs do not remain unresolved
  • add regression coverage for both early-exit paths

Fixes #2249

Validation

  • pnpm exec vitest run agents/src/voice/generation_tools.test.ts agents/src/voice/realtime_tool_output_commit.test.ts agents/src/voice/agent_activity.test.ts — 59 passed
  • pnpm exec vitest run agents/src — 115 files passed; 1,590 tests passed, 5 skipped
  • pnpm --filter @livekit/agents typecheck
  • pnpm --filter @livekit/agents build
  • pnpm -w lint:fix — all 40 packages passed with 145 existing warnings
  • pnpm -w format:check
  • git diff --check

Return an error output for calls rejected by toolChoice none and flush completed realtime tool outputs before interrupted generations exit.
@swayamg20
swayamg20 requested a review from a team as a code owner August 11, 2026 08:11
@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7be9c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 39 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-krisp Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-protoface Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

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.

toolChoice:'none' drops tool calls without emitting a functionResponse — permanently wedges mic input on Gemini Live

1 participant