Repository navigation
Fix Tichro voice falling back to M3 (case-sensitive lookup) - #6
Merged
Merged
Conversation
SupertonicEngine did two case-sensitive lookups on the incoming voice_name
— the AVAILABLE_VOICES membership check and the pre-cache lookup. A
user_preferences.voice_name row written before voice_set normalized casing
(e.g. 'tichro' instead of 'Tichro') would miss both, log "Invalid voice
…, using default M3", and synthesize with the engine's instance default
instead. The set-voice command still echoed the canonical name back, so
the user thinks they're on Tichro but hears M3.
Normalize selected_voice through a {lower(): canonical} index at synth
time so any historical casing maps to the right pre-cached style. Invalid
voices still log the existing warning and fall back to the default.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The existing CLAUDE.md covered the Docker/Railway server path but predated v0.1.0's GUI installer work. Adds sections for the PyQt6 GUI shell (gui_main.py, BotRunner threading, tab layout, .env vs QSettings persistence split), the PyInstaller + Inno Setup build pipeline (VERSION.TXT as version source, hiddenimports, AppId GUID, build_all.bat parser quirks), and touches up Bootstrap + Configuration sections to mention SUPER_TTS_GUI_MODE and the %APPDATA% .env path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The cog was reading tts.engines.<model>.* and tts.model from config.yaml,
neither of which has ever existed in this repo's config layout. engine_config
silently came back as {}, so the configured device and default voice never
reached SupertonicEngine — it always fell through to the function-signature
defaults (device='auto', voice='M3'). Aligned the cog and factory with the
actual tts.supertonic.* layout, and updated the config's default voice from
the dead 'custom' (no corresponding voice style ships) to 'M3'.
Also hardened SupertonicEngine.__init__ to validate the requested default
voice against AVAILABLE_VOICES case-insensitively and warn+fall-back to M3
if it's unknown, so a future config typo doesn't take down the bot at
startup with a FileNotFoundError from get_voice_style.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Heals existing user_preferences.voice_name and voice_claims.voice_id rows written before voice_set / claim_voice normalized case (e.g. 'tichro' → 'Tichro'). Runs in the standard migrate_*.sql phase per db/init_db.py:execute_sql_files. Idempotent: WHERE clauses only match rows whose stored value differs from the canonical form, so re-runs touch 0 rows. The runtime fix in tts/supertonic_engine.py already makes the bug non-symptomatic, but tidying the stored data prevents future ambiguity and makes /voice get show the right thing. 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
super_tts.user_preferences.voice_namewas written beforevoice_setstarted normalizing case (e.g. stored as'tichro'instead of'Tichro') was silently routed to the engine default voice.SupertonicEnginedid two case-sensitive lookups on the incomingvoice_name— theAVAILABLE_VOICESmembership check (tts/supertonic_engine.py:152) and the pre-cache lookup (:164) — and both missed. The/voice setcommand still echoed the canonical name back, so the user thought their pref was right but heard M3.tts.modelandtts.engines.<model>.*fromconfig.yaml, but the actual layout istts.supertonic.*.engine_configwas always{}in practice, so the configured device and default voice never reached the engine and it always fell back to the function-signature defaults. Rewired the cog + factory to read the real layout. Updatedconfig.yaml's default voice from the dead'custom'(no corresponding style ships) to'M3', and hardened the engine init to warn-and-fall-back if a future config typo names an unknown voice rather than crashing onFileNotFoundError.db/migrations/migrate_02_canonicalize_voice_name_case.sqlheals existing rows inuser_preferences.voice_nameandvoice_claims.voice_idto canonical casing. Runs as part of the standardmigrate_*.sqlphase; idempotent re-runs touch 0 rows.CLAUDE.mdwas missing (PyQt6 shell, BotRunner threading, persistence split, PyInstaller + Inno Setup pipeline).Test plan
SupertonicEnginethe same way the cog builds it, thensynthesize(voice_name='tichro')returned audio whose shape and md5 matched M3, not Tichro.'tichro'('Tichro','tichro','TICHRO','TiChRo') now produces the Tichro-shape audio buffer.'M3'/'m3'produce M3.'bogus'still falls back to M3 with the existingInvalid voice …, using default M3warning.engine_config from tts.supertonic: {'device': 'auto', 'voice': 'M3'}actually reaches the engine now; the resilience guard catches a deliberately bogus'NotAReal'voice and falls back to M3 with a warning rather than aborting startup withFileNotFoundError./voice set tichroand a TTS message in voice channel.🤖 Generated with Claude Code