{"record":{"id":"1d16bbafeea33f04","repo":"janhq/jan","slug":"provider-must-have-base-url-configured-1d16bb","errorCode":null,"errorMessage":"Provider must have base_url configured","messagePattern":"Provider must have base_url configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"web-app/src/services/providers/tauri.ts","lineNumber":149,"sourceCode":"\n      return runtimeProviders.concat(builtinProviders as ModelProvider[])\n    } catch (error: unknown) {\n      console.error('Error getting providers in Tauri:', error)\n      return []\n    }\n  }\n\n  async deleteProviderKeys(providerName: string): Promise<void> {\n    try {\n      await invoke('delete_provider_keys', { provider: providerName })\n    } catch (error) {\n      console.error(`Failed to delete keyring keys for ${providerName}:`, error)\n    }\n  }\n\n  async fetchModelsFromProvider(provider: ModelProvider): Promise<string[]> {\n    if (!provider.base_url) {\n      throw new Error('Provider must have base_url configured')\n    }\n\n    try {\n      const keyChain = providerRemoteApiKeyChain(provider)\n      const keyAttempts: (string | undefined)[] =\n        keyChain.length > 0 ? keyChain : [undefined]\n\n      let lastStatus = 0\n      let lastStatusText = ''\n\n      for (let ki = 0; ki < keyAttempts.length; ki++) {\n        const key = keyAttempts[ki]\n        const headers: Record<string, string> = {\n          'Content-Type': 'application/json',\n        }\n\n        if (\n          provider.base_url.includes('localhost:') ||","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/web-app/src/services/providers/tauri.ts#L131-L167","documentation":"A validation guard thrown at the top of fetchModelsFromProvider in the Tauri provider service. The method expects the given ModelProvider to expose a base_url so it can issue an HTTP request to the provider's OpenAI-compatible endpoint to list models; when provider.base_url is empty or undefined it cannot construct the request and throws this sentinel error instead. It fires for built-in or runtime providers configured without a base URL (e.g., local-only providers with no endpoint), and callers of fetchModelsFromProvider are expected to catch it and surface the configuration problem to the user.","triggerScenarios":"fetchModelsFromProvider called with a ModelProvider object whose base_url is undefined/empty — e.g. a provider entry created without an endpoint.","commonSituations":"Manually added provider missing base_url, provider config imported incompletely, or built-in provider whose base_url was cleared in settings.","solutions":["Set the base_url field on the provider (e.g. https://api.openai.com/v1)","Re-add the provider with a complete configuration","Validate base_url before calling fetchModelsFromProvider","Reset the provider to its default settings"],"exampleFix":"// before\nconst models = await fetchModelsFromProvider(provider)\n// after\nif (!provider.base_url) throw new Error('Configure base_url before fetching models')\nconst models = await fetchModelsFromProvider(provider)","handlingStrategy":"validation","validationCode":"if (!provider.base_url) throw new Error('Provider missing base_url')","typeGuard":"function hasBaseUrl(p: ModelProvider): p is ModelProvider & { base_url: string } { return typeof p.base_url === 'string' && p.base_url.length > 0 }","tryCatchPattern":"try { models = await fetchModelsFromProvider(provider) } catch (e) { if (String(e).includes('base_url')) openProviderSettings(provider); else throw e }","preventionTips":["Require base_url when creating provider entries","Validate provider configs on import","Mark providers without base_url as incomplete in the UI"],"tags":["provider","validation","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}