{"record":{"id":"aa1c5012b8ee7aaa","repo":"moeru-ai/airi","slug":"invalid-transcription-model-currentmodel-dete","errorCode":null,"errorMessage":"Invalid transcription model \"${currentModel}\" detected. Resetting to default \"whisper-1\".","messagePattern":"Invalid transcription model \"(.+?)\" detected\\. Resetting to default \"whisper-1\"\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/stage-pages/src/pages/settings/providers/transcription/openai-compatible-audio-transcription.vue","lineNumber":173,"sourceCode":"  if (modelName.includes('gpt-4') && !modelName.includes('transcribe') && !modelName.includes('whisper'))\n    return false\n  return true\n}\n\n// Initialize provider settings on mount\nonMounted(async () => {\n  providersStore.initializeProvider(providerId)\n  // Initialize baseUrl with default if not set\n  if (!providers.value[providerId]?.baseUrl) {\n    const defaultBaseUrl = providersStore.getDefaultProviderConfig(providerId).baseUrl as string | undefined\n    if (defaultBaseUrl) {\n      baseUrl.value = defaultBaseUrl\n    }\n  }\n  // Validate and reset model if it's invalid (e.g., a chat model)\n  const currentModel = model.value\n  if (currentModel && !isValidTranscriptionModel(currentModel)) {\n    console.warn(`Invalid transcription model \"${currentModel}\" detected. Resetting to default \"whisper-1\".`)\n    model.value = 'whisper-1'\n  }\n  // Load models if API key and base URL are configured\n  if (apiKey.value && baseUrl.value) {\n    await providersStore.loadModelsForConfiguredProviders()\n    await providersStore.fetchModelsForProvider(providerId)\n  }\n})\n\n// Watch for API key and base URL changes to reload models\nwatch([apiKey, baseUrl], async ([newApiKey, newBaseUrl]) => {\n  if (newApiKey && newBaseUrl) {\n    await providersStore.fetchModelsForProvider(providerId)\n  }\n})\n\n// Watch model changes to save to provider config\nwatch(model, () => {","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/stage-pages/src/pages/settings/providers/transcription/openai-compatible-audio-transcription.vue#L155-L191","documentation":"Emitted by the OpenAI-compatible audio transcription settings page in onMounted. The page validates the persisted transcription model with isValidTranscriptionModel(); if the stored value is not a recognized transcription model (e.g. a chat model such as gpt-4o-mini), it warns and overwrites the setting with 'whisper-1'. It is a self-healing guard against provider settings saved for a different provider kind, not a thrown exception.","triggerScenarios":"Opening Settings > Providers > openai-compatible-audio-transcription when the stored model value fails isValidTranscriptionModel(): a chat model id saved in the field earlier, a hand-edited providers localStorage entry, or a value left over from before this provider was split from a shared config.","commonSituations":"User pasted a chat model id into the transcription model field; settings persisted by an older app version where the model field was shared across provider kinds; a custom OpenAI-compatible endpoint whose transcription models are not on the validator's allowlist.","solutions":["Let the auto-reset apply (the page already writes model = 'whisper-1'), then select a real transcription model in the provider settings and save","Inspect the persisted providers store (localStorage) for the openai-compatible-audio-transcription entry and remove the stale model value","If your endpoint offers transcription models the validator rejects, extend isValidTranscriptionModel to accept them","With API key and base URL configured, let the page fetch models and pick one returned by the endpoint"],"exampleFix":"// before (settings page saves whatever the user typed)\nmodel.value = selectedModelId\n\n// after (validate at save time)\nif (selectedModelId && !isValidTranscriptionModel(selectedModelId)) {\n  console.warn(`Invalid transcription model \"${selectedModelId}\" detected. Resetting to default \"whisper-1\".`)\n  model.value = 'whisper-1'\n}\nelse {\n  model.value = selectedModelId\n}","handlingStrategy":"validation","validationCode":"// Before saving the transcription model in provider settings\nimport { isValidTranscriptionModel } from '../validations'\n\nfunction saveTranscriptionModel(value: string) {\n  if (!isValidTranscriptionModel(value)) {\n    console.warn(`Invalid transcription model \"${value}\" detected. Resetting to default \"whisper-1\".`)\n    return 'whisper-1'\n  }\n  return value\n}","typeGuard":"function isTranscriptionModelName(value: unknown): value is string {\n  return typeof value === 'string' && value.length > 0 && isValidTranscriptionModel(value)\n}","tryCatchPattern":null,"preventionTips":["Validate the model field at save time, not only at page mount, so invalid values never persist","When reusing provider configs across provider kinds, clear model fields that do not apply","Extend the validator whenever you add a custom transcription endpoint with new model names"],"tags":["settings","provider-config","transcription","openai-compatible","self-healing"],"backgroundTag":"invalid-model-name","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}