{"record":{"id":"a87567c8f7d905aa","repo":"moeru-ai/airi","slug":"vision-provider-model-not-configured","errorCode":null,"errorMessage":"Vision provider/model not configured","messagePattern":"Vision provider/model not configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/stage-ui/src/composables/vision/use-vision-inference.ts","lineNumber":47,"sourceCode":"  const base64 = meta?.includes('base64') ? data : btoa(data)\n  return {\n    mimeType,\n    base64,\n    url: `data:${mimeType};base64,${base64}`,\n  }\n}\n\nexport function useVisionInference() {\n  const llmStore = useLLM()\n  const providersStore = useProviderStore()\n  const visionStore = useVisionStore()\n  const { activeProvider, activeModel, ollamaThinkingEnabled } = storeToRefs(visionStore)\n\n  const lastText = ref('')\n\n  async function runVisionInference(input: VisionInferenceInput) {\n    if (!activeProvider.value || !activeModel.value)\n      throw new Error('Vision provider/model not configured')\n\n    const provider = await providersStore.getChatProviderInstance(activeProvider.value)\n    const workload = getVisionWorkload(input.workloadId)\n    const prompt = input.promptOverride ?? workload.prompt\n    const { url } = parseDataUrl(input.imageDataUrl)\n    const visionProvider: GenerationProvider = activeProvider.value === 'vision-ollama'\n      ? {\n          generation(model) {\n            const request = provider.generation(model)\n            if (request.protocol !== 'chat-completions')\n              return request\n            return { ...request, config: { ...request.config, think: ollamaThinkingEnabled.value } }\n          },\n        }\n      : provider\n\n    const context: Conversation = { turns: [{\n      id: 'vision-input',","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/moeru-ai/airi/blob/438a067dde47aa0bdb46c2323d1fe293dc805218/packages/stage-ui/src/composables/vision/use-vision-inference.ts#L29-L65","documentation":"runVisionInference throws this pre-flight check before any provider instance is created: the vision store must have both activeProvider and activeModel set. It is a configuration error, not a network one — image inference cannot run until a vision provider and model have been selected in settings.","triggerScenarios":"Fresh install where vision settings were never configured; after resetSettingsState() cleared the persisted stores; calling runVisionInference programmatically (devtool, automation, or test) without seeding the store first.","commonSituations":"Onboarding not completed; user switched devices so settings storage is empty; a script or test invokes the composable without selecting a provider.","solutions":["Open vision settings and select a provider and a model, then retry","If invoking programmatically, seed visionStore activeProvider and activeModel before running","Guard the call site so the UI routes to settings instead of surfacing a raw error","Re-select the vision provider after any settings reset"],"exampleFix":"// before\nawait runVisionInference({ workloadId, imageDataUrl }) // throws: not configured\n\n// after\nif (!visionStore.activeProvider || !visionStore.activeModel) {\n  openSettingsPage('vision')\n  return\n}\nawait runVisionInference({ workloadId, imageDataUrl })","handlingStrategy":"validation","validationCode":"const ready = Boolean(visionStore.activeProvider && visionStore.activeModel)\nif (!ready)\n  openSettingsPage('vision')","typeGuard":null,"tryCatchPattern":"try {\n  await runVisionInference(input)\n}\ncatch (err) {\n  if (err instanceof Error && err.message === 'Vision provider/model not configured')\n    openSettingsPage('vision')\n}","preventionTips":["Disable the run action until both store fields are set","Persist the vision selection and verify it loads before first use","Re-require selection after settings resets"],"tags":["vision","configuration","provider","precondition"],"backgroundTag":"missing-configuration","analyzedSha":"438a067dde47aa0bdb46c2323d1fe293dc805218","analyzedAt":"2026-09-17T01:14:42.644Z","contentChangedAt":"2026-09-17T01:14:42.644Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}