Skip to content

fix(audio): honor ElevenLabs agent speed and style - #1707

Open
pcbeingused33 wants to merge 1 commit into
nextlevelbuilder:devfrom
pcbeingused33:fix/elevenlabs-agent-voice-settings
Open

pcbeingused33 wants to merge 1 commit into
nextlevelbuilder:devfrom
pcbeingused33:fix/elevenlabs-agent-voice-settings

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

Summary

The agent parameter adapter adds flat voice_settings.speed and voice_settings.style overrides, but ElevenLabs previously looked up both values only in the nested provider configuration. Resolve flat numeric overrides first and fall back to nested settings when an override is absent. This preserves other configured voice settings.

Type

  • Bug fix

Target Branch

dev

Checklist

  • go build ./... passes
  • go build -tags sqliteonly ./... passes (if Go changes)
  • go vet ./... passes
  • Tests pass: go test -race ./... (ran go test -race ./internal/audio/...)
  • Web UI builds: cd ui/web && pnpm build (if UI changes) (N/A, no UI changes)
  • No hardcoded secrets or credentials
  • SQL queries use parameterized $1, $2 (no string concat) (N/A, no SQL)
  • New user-facing strings added to all 3 locales (en/vi/zh) (N/A, no new strings)
  • Migration version bumped in internal/upgrade/version.go (if new migration) (N/A, no migration)

Test Plan

  • Added a regression test that passes agent overrides through the audio manager and checks the ElevenLabs request body. Before the fix, speed and style came from the provider settings. With the fix, the request contains the agent's speed and style and retains the configured stability.
  • go test ./internal/audio ./internal/audio/elevenlabs -count=1 and go test -race ./internal/audio/... -count=1

Surface parity: The API contract, web UI, and CLI/runtime package are N/A because this corrects how the existing settings are serialized for ElevenLabs.

AI assistance was used to develop the patch and regression test.

@clark-cant clark-cant 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.

Summary: Fixes ElevenLabs TTS so agent-level speed/style overrides are honored. AdaptAgentParams maps the generic keys to flat dotted keys (voice_settings.speed, voice_settings.style) and merges them into opts.Params, but resolveELFloat read only via audio.GetNested, which parses the dot path and traverses the nested voice_settings map — so a flat dotted key was never seen and the provider's nested config won. The fix looks up the literal key first and falls back to the nested lookup. 2 files, +37/−6.

Risk level: Low.

Mandatory gates:

  • Duplicate / prior implementation: clear. gh pr list --state all --search "elevenlabs speed style voice_settings" and the matching issue search are empty; the adapter table in internal/audio/agent_params_adapter.go already documents the elevenlabs mapping (speed → voice_settings.speed, style → voice_settings.style), so this closes the gap between the adapter and the resolver rather than duplicating it.
  • Project standards: docs found (CLAUDE.md). Change follows existing Go conventions; no i18n/migration/SQL surface affected. Build/vet/test path unaffected.
  • Strategic necessity: clear value. Real bug fix — restores agent-configured TTS speed/style for ElevenLabs, which were silently dropped. Small, well-scoped.

Findings:

  • Suggestion — resolveELFloat now diverges from its siblings (resolveELBool / resolveELString / resolveELInt remain nested-only). Harmless today because only speed/style (both floats) are adapted for ElevenLabs, but a one-line comment (or a shared flat-first helper) would prevent drift if a non-float override is added later.
  • Note — dropping the params == nil guard is safe: reading from a nil map returns the zero value with ok=false, and GetNested on a nil map returns (nil,false) without panicking.

Verdict: Approve — no critical or important issues. mergeable=MERGEABLE, mergeStateStatus=CLEAN; all three CI checks green (run 46323108263: release-versioning, go, web). Test TestSynthesize_AgentVoiceSettings is a genuine regression test (fails before the fix, passes after).

Posted by /ck:review-pr at 2026-11-30T01:08:25Z

@clark-cant clark-cant added agent:github-maintain Processed by github-maintain automation maintain:triaged Triaged by maintain workflow pr:reviewed Reviewed by maintainer labels Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:github-maintain Processed by github-maintain automation maintain:triaged Triaged by maintain workflow pr:reviewed Reviewed by maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants