You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] TextToSpeech: resolve bare sample names against ~/.infer/models/tts/samples/ #1174
The desktop app (inference-gateway/desktop#188) added a voice samples library that stores WAV reference recordings for voice cloning in ~/.infer/models/tts/samples/. Today the TextToSpeech tool's resolveSamplePath (added in #1115) only resolves the sample argument as given, so a sample uploaded through the desktop library cannot be referenced by bare name - the desktop tab currently works only as a managed file library, not end-to-end cloning.
Make resolveSamplePath fall back to ~/.infer/models/tts/samples/<name> when the given sample path does not exist as-is (absolute paths and paths relative to the working directory keep taking precedence). Then TextToSpeech(sample: "my-voice.wav") picks up a sample uploaded via the desktop, with no desktop-side changes needed.
Acceptance Criteria
A bare sample name that does not resolve as an absolute or cwd-relative path is looked up in ~/.infer/models/tts/samples/
Existing absolute / relative sample paths resolve exactly as before
A sample that resolves nowhere still fails with a clear error naming the paths tried
What changed (internal/agent/tools/text_to_speech.go, +66/-14 across 2 files with tests):
resolveSamplePath keeps the sandbox-validated working-directory lookup first, then falls back to the desktop voice samples library: ~/.infer/models/tts/samples/<name>, resolved via os.UserHomeDir() + config.ConfigDirName, mirroring the TTS models-dir default in internal/audio/ttsmodel.go. New voiceSamplesDir() helper; sandbox validation stays on the cwd candidate only (the samples library is a fixed, desktop-managed $HOME/.infer path reached only via an already-guarded bare name).
Absolute paths and paths with separators keep resolving exactly as before (still rejected by the bare-name guard); a sample found nowhere fails with voice_sample %q not found as a readable WAV file (tried: <cwd path>, <samples path>) - naming both paths tried.
Updated the voice_sample tool parameter description so models know bare names may reference the samples library.
Tests: new TestTextToSpeechTool_SamplePathFallback (cwd sample takes precedence, bare name falls back to the library, miss errors naming both paths); pinned HOME in TestTextToSpeechTool_Validate so bare-name resolution stays hermetic.
Checks: go test ./internal/agent/tools/, task fmt, task vet (-tags "purego"), and the pre-commit gate (mod tidy, import-alias lint, golangci-lint 0 issues, markdownlint) all green; tree clean and pushed. All three acceptance criteria are covered by the new test.
Bookkeeping: issue added to Roadmap 2026 (In progress -> QA); [DOCS] follow-up filed at inference-gateway/docs#657 (docs don't yet cover voice_sample resolution); no desktop-side changes needed (referenced desktop#188 in the PR). No release steps taken - the fix(tts): commit message drives semantic-release on merge.
Merge readiness: ready - minimal diff, reuses the existing models-dir pattern, no new dependencies, tests pin the new behavior. Nothing deferred; a human just reviews and merges.
Activity
edenreich commentedon Sep 4, 2026
@infer can you work on this? use /ponytail:ponytail /go /go-concurrency
inference-gateway-maintainer commentedon Sep 4, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1175
✅ Infer Result: Success
All verification passes: clean tree on
fix/issue-1174, in sync with origin, PR #1175 exists and is ready for review.Done. PR: #1175 (ready for review)
What changed (
internal/agent/tools/text_to_speech.go, +66/-14 across 2 files with tests):resolveSamplePathkeeps the sandbox-validated working-directory lookup first, then falls back to the desktop voice samples library:~/.infer/models/tts/samples/<name>, resolved viaos.UserHomeDir()+config.ConfigDirName, mirroring the TTS models-dir default ininternal/audio/ttsmodel.go. NewvoiceSamplesDir()helper; sandbox validation stays on the cwd candidate only (the samples library is a fixed, desktop-managed$HOME/.inferpath reached only via an already-guarded bare name).voice_sample %q not found as a readable WAV file (tried: <cwd path>, <samples path>)- naming both paths tried.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 library, miss errors naming both paths); pinnedHOMEinTestTextToSpeechTool_Validateso bare-name resolution stays hermetic.Checks:
go test ./internal/agent/tools/,task fmt,task vet(-tags "purego"), and the pre-commit gate (mod tidy, import-alias lint, golangci-lint 0 issues, markdownlint) all green; tree clean and pushed. All three acceptance criteria are covered by the new test.Bookkeeping: issue added to Roadmap 2026 (In progress -> QA);
[DOCS]follow-up filed at inference-gateway/docs#657 (docs don't yet covervoice_sampleresolution); no desktop-side changes needed (referenced desktop#188 in the PR). No release steps taken - thefix(tts):commit message drives semantic-release on merge.Merge readiness: ready - minimal diff, reuses the existing models-dir pattern, no new dependencies, tests pin the new behavior. Nothing deferred; a human just reviews and merges.
Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 8m 46sTokens: 2,623,699 in · 40,149 out · 2,663,848 total (35 requests)
Tool calls: 49 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
fix(tts): fall back to ~/.infer/models/tts/samples for bare voice sam…
inference-gateway-releaser commentedon Sep 4, 2026
🎉 This issue has been resolved in version 0.189.1 🎉
The release is available on:
Your semantic-release bot 📦🚀