improve language-model compatibility error messages with docs URL

This commit is contained in:
leonardotrapani
2026-02-01 13:34:50 +01:00
parent 811ca71c08
commit 170ac22e3c
6 changed files with 70 additions and 12 deletions
+11
View File
@@ -584,4 +584,15 @@ Started: Sun Feb 1 12:22:47 AM CET 2026
- whisper-cpp: https://github.com/openai/whisper#available-models-and-languages
- LLM models don't have DocsURL (not needed - no language restrictions)
- Added TestAllTranscriptionModels_HaveDocsURL test verifying all transcription models have correct URLs
- All tests passing, typecheck passes
### Task 10: Improve language-model compatibility error messages
- Updated `ValidateModelLanguageCompatibility` in internal/config/validate.go
- Updated `ValidateModelLanguage` in internal/provider/provider.go
- Error now includes: model Name (not ID), language Name (not just code), DocsURL, first 5 supported languages
- Format: "model {Name} does not support {LanguageName} ({code}). See {DocsURL} for full list. Supported: {langs}..."
- Truncated languages list from 10 to 5 for more concise errors
- TUI already displays err.Error() so improvements propagate automatically
- Added TestValidateModelLanguage_ErrorFormat test verifying error includes model name, docs URL, and language
- Updated test expectations in config_test.go for new error format
- All tests passing, typecheck passes