Skip to content

fix(deepgram): avoid double-encoding STT query params#1295

Open
Raysharr wants to merge 2 commits intolivekit:mainfrom
Raysharr:codex/fix-deepgram-double-encoding
Open

fix(deepgram): avoid double-encoding STT query params#1295
Raysharr wants to merge 2 commits intolivekit:mainfrom
Raysharr:codex/fix-deepgram-double-encoding

Conversation

@Raysharr
Copy link
Copy Markdown
Contributor

@Raysharr Raysharr commented Apr 22, 2026

Summary

  • preserve Deepgram STT query parameters for keyterm and keywords, including non-ASCII values
  • add regression coverage so Deepgram receives the original terms instead of percent-escaped text

Description

The Deepgram STT websocket URL currently turns keyterm and keywords values into percent-escaped strings before they are added to the query string. URLSearchParams already performs query encoding, so these values end up encoded twice.

That means Deepgram can receive values like s%C5%82ucham instead of słucham. The request still succeeds, but keyword prompting silently stops working for languages that rely on diacritics. The same issue also affects boosted keywords entries.

Why this matters

  • it breaks keyterm prompting for languages such as Polish, Czech, German, Spanish, and Portuguese
  • it can break keywords boosts when the values include non-ASCII text or : separators
  • the failure is silent, so users see degraded transcription quality without an explicit error

Testing

  • Added regression coverage for non-ASCII keyterm values and boosted keywords
  • pnpm vitest run plugins/deepgram/src/_utils.test.ts

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: c82d8f8

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

This PR includes changesets to release 26 packages
Name Type
@livekit/agents-plugin-deepgram Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic 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-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test 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

@Raysharr Raysharr changed the title [codex] Fix Deepgram query parameter encoding fix(deepgram): avoid double-encoding STT query params Apr 22, 2026
@Raysharr Raysharr marked this pull request as ready for review April 22, 2026 17:58
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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.

1 participant