Skip to content

fix(pipeline): surface validation error details in tool execution#5329

Draft
nickderobertis wants to merge 1 commit intolivekit:mainfrom
nickderobertis:nick/eng-2596-fixlk-sdk-surface-validation-error-details-in-voice-path
Draft

fix(pipeline): surface validation error details in tool execution#5329
nickderobertis wants to merge 1 commit intolivekit:mainfrom
nickderobertis:nick/eng-2596-fixlk-sdk-surface-validation-error-details-in-voice-path

Conversation

@nickderobertis
Copy link
Copy Markdown

@nickderobertis nickderobertis commented Apr 3, 2026

Summary

  • Wraps ValidationError/ValueError in ToolError in voice/generation.py's _execute_tools_task, matching the pattern established by fix(llm): surface validation error details to LLM on function call argument failures #5193 for the realtime path
  • Changes logger.exception to logger.warning to match the realtime path convention
  • Without this fix, the LLM only sees "An internal error occurred" instead of the actual validation error details when tool argument parsing fails in the voice path

Context

#5193 fixed this for the realtime path (llm/utils.py), but the equivalent pipeline code in voice/generation.py was not updated.

Fixes #5164 (voice path)

Test plan

  • Added unit tests verifying ToolError surfaces message in make_tool_output while raw ValueError produces generic message
  • Existing TestExecuteFunctionCallValidationErrors tests still pass
  • make check passes (format, lint, type-check)
  • Install package from this branch and manually test in a real application

🤖 Generated with Claude Code

…tion

Wrap ValidationError/ValueError in ToolError in voice/generation.py's
_execute_tools_task, matching the pattern from PR livekit#5193 for the realtime
path. Without this, the LLM only sees "An internal error occurred"
instead of the actual validation error details.

Resolves ENG-2596

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 3, 2026

CLA assistant check
All committers have signed the CLA.

@nickderobertis nickderobertis changed the title fix(voice): surface validation error details in tool execution fix(pipeline): surface validation error details in tool execution Apr 3, 2026
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.

Return validation error details to LLM on function call argument failures

2 participants