Repository navigation
fix(tts): fall back to ~/.infer/models/tts/samples for bare voice sample names - #1175
Merged
Merged
Conversation
…ple names A voice_sample that is not found in the working directory is now looked up in the desktop voice samples library (~/.infer/models/tts/samples), so samples uploaded via the desktop work end to end. Absolute and cwd-relative sample paths resolve exactly as before, and a sample found nowhere fails with an error naming both paths tried. Resolves #1174
Closed
3 tasks
inference-gateway-maintainer
Bot
marked this pull request as ready for review
September 4, 2026 01:18
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
September 4, 2026 01:18
3 tasks
edenreich
reviewed
Sep 4, 2026
Contributor
|
🎉 This PR is included in version 0.189.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Resolves #1174
Summary
TextToSpeech.resolveSamplePathnow falls back to the desktop voice samples library (~/.infer/models/tts/samples/<name>) when a barevoice_samplename is not found in the working directory, so WAV samples uploaded through the desktop samples library (inference-gateway/desktop#188) work end to end without desktop-side changes. Absolute paths and paths containing separators keep resolving exactly as before (still rejected by the bare-name guard), and a sample that resolves nowhere fails with a clear error naming both paths tried.Changes
internal/agent/tools/text_to_speech.go:resolveSamplePathkeeps the sandbox-validated working-directory lookup as the primary candidate, then tries<samples>/<name>; the newvoiceSamplesDir()helper resolves~/.infer/models/tts/samplesfromos.UserHomeDir()+config.ConfigDirName, mirroring the TTS models dir default ininternal/audio/ttsmodel.go.$HOME/.inferreached only via an already-guarded bare file name.voice_sample %q not found as a readable WAV file (tried: <cwd path>, <samples path>).voice_sampletool parameter description so models know bare names may reference the samples library.TestTextToSpeechTool_SamplePathFallback(cwd sample takes precedence, bare name falls back to the samples library, miss errors naming both paths); pinnedHOMEinTestTextToSpeechTool_Validateso bare-name resolution stays hermetic.Checks
go test ./internal/agent/tools/,task fmt,task vetand the pre-commit gate (mod tidy, import-alias lint, golangci-lint 0 issues, markdownlint) all pass.