add runtime language-model compatibility check with fallback to auto-detect

This commit is contained in:
leonardotrapani
2026-02-01 02:09:37 +01:00
parent 700f7fb633
commit a105c8c5a8
4 changed files with 111 additions and 2 deletions
+11 -1
View File
@@ -458,4 +458,14 @@ Started: Sun Feb 1 12:22:47 AM CET 2026
- LLM validation also refactored to use registry
- Removed old hardcoded `isValidLanguageCode()` function
- Updated tests: replaced TestIsValidLanguageCode with TestValidateModelLanguageCompatibility
- All tests passing, typecheck passes
- All tests passing, typecheck passes
### Task 42: Add runtime language-model compatibility check with fallback
- Updated `internal/transcriber/transcriber.go` NewTranscriber()
- Added runtime check after model lookup: `if config.Language != "" && !model.SupportsLanguage(config.Language)`
- Logs warning with model ID and language name
- Sends desktop notification via `notify.NewDesktop(nil).Error(...)` alerting user of fallback
- Overrides `config.Language = ""` (auto) for this transcription session
- This is a safety net for manually-edited configs; primary validation is at config-time (hard error)
- Added 4 tests: LanguageFallback, AutoLanguageNoFallback, CompatibleLanguageNoFallback, MultilingualModelAllLanguages
- All tests passing with -race flag, typecheck passes