fix(tts): unify voice resolution — dashboard /tts settings now affect the tts tool#1175
Open
vanducng wants to merge 1 commit into
Open
Conversation
… the tts tool (#172) The dashboard /tts page writes to system_configs[tts.<provider>.voice], but the LLM-invoked tts tool was only checking args > agent OtherConfig > builtin_tool_tenant_configs[tts].default_voice_id. Two different storage locations → the user's chosen voice was ignored, Edge defaulted to en-US-AriaNeural even when "HoaiMy" (vi-VN-HoaiMyNeural) was set correctly in the dashboard. Add system_configs as a 4th-level fallback so the dashboard becomes the single source of truth. - TtsTool gains SetSystemConfigStore(s) setter - resolveVoiceAndModel takes providerName + looks up tts.<provider>.voice/model when no higher-precedence source set - effectiveProvider resolved BEFORE voice/model so the right key is hit - Wired at gateway boot in cmd/gateway.go (after pgStores ready) - 4 unit tests covering: fallback, arg precedence, no-store, empty provider Verified against production trace 019e6036-44bb-703b-85fa-dee34f7ab2c0 where the tts tool was called with provider=edge, no voice arg, and defaulted to English instead of the configured Vietnamese voice.
Contributor
|
Backlog review: merge-candidate. The PR fixes the dashboard-vs-tool TTS voice/model drift with explicit precedence and regression coverage for system_configs fallback. go and web checks are passing, and the scope is focused enough for merge review. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Real-world bug
A user configured Vietnamese voice "HoaiMy" (`vi-VN-HoaiMyNeural`) on the dashboard `/tts` page. The Test Playground worked. But when the LLM invoked the `tts` tool, Edge synthesized English instead.
Root cause — two TTS storage locations
When the LLM calls `tts` without an explicit `voice` arg, the resolution chain (`args > agent OtherConfig > tenant builtin`) finds no override → empty voice → Edge falls back to its built-in default (English).
Fix
Add `system_configs` as a 4th-level fallback so the dashboard is the single source of truth:
```
args > agent OtherConfig > tenant builtin > system_configs[tts..voice]
```
Tests
4 new unit tests in `internal/tools/tts_systemconfigs_fallback_test.go`:
All existing `tts` tests still pass.
Verification
Cherry-picked from fork's PR dataplanelabs#172.