Repository navigation
Fix Tichro voice cache miss on Railway (cache dir + lock drift) - #7
Merged
Merged
Conversation
- Auxiliary docs list now mentions RAILWAY_SETUP.md (with overlap note) and flags DIAGNOSTIC_REPORT.md as a historical audit, not a live reference. - Database section: explicit that only create_*/migrate_* are auto-run, and that fix_05_voice_claims_partial_unique.sql despite being referenced is dormant under the current runner. - New voice-name casing subsection covers migrate_02 + the runtime case-insensitive lookup safety net. - Bootstrap step 7 corrected: the GUI ready observer fires on both on_connect and on_ready. - Configuration sources: tts.supertonic.voice is the fallback voice, not a global default. - Pytest example now uses a real selector (TestDBConnect); mentions the shared fixtures in tests/conftest.py. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…a lock SupertonicEngine was copying bundled voice JSONs to a hardcoded ~/.cache/supertonic2/voice_styles/ destination. The installed supertonic library actually loads voice styles from its own model_dir, which is ~/.cache/supertonic2 for the supertonic-2 model and ~/.cache/supertonic3 for supertonic-3, etc. When Railway resolved a newer supertonic (because poetry.lock wasn't tracked and ^1.1 picked the latest 1.x), the model became supertonic-3 and the cache copy landed in the wrong directory: supertonic.loader - ERROR - Voice style 'Tichro' not found. Available voice styles: F1, F2, F3, F4, F5, M1, M2, M3, M4, M5 Tichro then failed pre-cache and synthesis fell back silently to the default voice (M3). Only Tichro was affected because M1-M5/F1-F5 ship inside the downloaded model package. Two changes: 1. tts/supertonic_engine.py: resolve the destination from self.tts.model_dir instead of hardcoding 'supertonic2'. Works against whichever model the installed library actually loaded. 2. poetry.lock and poetry.toml are now tracked. The .gitignore already said "keep poetry.lock for reproducible builds" but the lock had never been git-added, so the Dockerfile's COPY pyproject.toml poetry.lock* was a no-op for the lock and every build re-resolved dependencies. Tracking the lock pins supertonic to 1.1.2 deterministically. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI failed installing dependencies with "pyproject.toml changed significantly since poetry.lock was last generated" — the previously-committed lock had been generated before commit fa94429 added pytest-asyncio / pytest-mock / pytest-cov to [tool.poetry.group.dev.dependencies], so the content-hash no longer matched. Regenerated via `poetry lock` (refreshes the hash and fills in transitive deps; does not bump anything that was already pinned). Verified: - supertonic stays at 1.1.2 (the whole reason we tracked the lock) - pytest stays at 7.4.4 - Net change is the addition of TTS (Coqui) + its transitive deps, which pyproject's TTS = "^0.22" already required — they were missing from the prior lock for unknown historical reasons. No-op for production since TTS was already being resolved fresh on every Railway build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
SupertonicEnginecopiedvoices/Tichro.jsonto a hardcoded~/.cache/supertonic2/voice_styles/, but Railway's installedsupertoniclibrary had drifted to a newer 1.x release that defaults to thesupertonic-3model with cache dir~/.cache/supertonic3/. The file landed in the wrong directory,tts.get_voice_style('Tichro')raised FileNotFoundError, and synthesis fell back to the default voice on every request from him.self.tts.model_dir), and start trackingpoetry.lockso the Docker build can finally honor the supertonic pin (the.gitignorealready had a comment intending to keep it but the file had never beengit added).Changes
tts/supertonic_engine.py— destination is nowPath(self.tts.model_dir) / 'voice_styles', version-agnostic.poetry.lock+poetry.toml— now tracked. Lock pinssupertonic 1.1.2deterministically; the in-project venv convention frompoetry.tomlis captured too.CLAUDE.md— unrelated doc improvements riding along on this branch: clarifies migration runner picks up onlycreate_*/migrate_*(so the referencedfix_05_…is actually dormant), documents the voice-name casing canonicalization rule, corrects that the ready observer fires on bothon_connectandon_ready, and notestts.supertonic.voiceis a fallback rather than a global default.Heads-up
Pinning to
supertonic 1.1.2will downgrade Railway's runtime from thesupertonic-3model back tosupertonic-2on the next deploy. M1–M5 / F1–F5 may sound subtly different from current production. Tichro will work either way — the engine fix is what restores his voice.Test plan
Loaded unicode indexer from /home/ttsbot/.cache/supertonic2/onnx/…(model 2, not 3).Voice style 'Tichro' not foundline.🤖 Generated with Claude Code