{"record":{"id":"cbb6e3a0ee451ea9","repo":"moeru-ai/airi","slug":"missing-llm-configuration-model-modelid-provider-providerid","errorCode":null,"errorMessage":"Missing LLM configuration (Model: ${modelId}, Provider: ${providerId})","messagePattern":"Missing LLM configuration \\(Model: (.+?), Provider: (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/stage-ui/src/stores/modules/artistry-autonomous.ts","lineNumber":157,"sourceCode":"        {\n          role: 'user',\n          content: analysisPrompt,\n        },\n      ]\n\n      const modelId = consciousnessStore.activeModel\n      const providerId = consciousnessStore.activeProvider\n\n      artistLog('Sending rolled-up prompt to Director LLM...', {\n        model: modelId,\n        provider: providerId,\n        historyCount: recentHistory.length,\n        textSubstring: inputText.substring(0, 50),\n        target,\n      })\n\n      if (!modelId || !providerId) {\n        throw new Error(`Missing LLM configuration (Model: ${modelId}, Provider: ${providerId})`)\n      }\n\n      const chatProvider = await providersStore.getChatProviderInstance(providerId)\n\n      // NOTICE: Artificial 10s delay for USER target to avoid race conditions/429s.\n      // Skipped for ASSISTANT target as the main response is already finalized.\n      if (target === 'user') {\n        artistLog('User target detected. Applying 10s safety delay...')\n        await new Promise(resolve => setTimeout(resolve, 10000))\n      }\n\n      // 2. Call LLM (Non-streaming for structured data)\n      // Bypasses the chat orchestrator's llm_request_* funnel — emit a\n      // dedicated event so Director LLM cost is separable from chat.\n      useAnalytics().trackAutonomousGenerateText({\n        model: modelId,\n        reason: target,\n      })","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/moeru-ai/airi/blob/438a067dde47aa0bdb46c2323d1fe293dc805218/packages/stage-ui/src/stores/modules/artistry-autonomous.ts#L139-L175","documentation":"runArtistTask resolves the model and provider ids for the artistry LLM call and throws if either is missing before instantiating the chat provider. The error embeds the current values (possibly undefined) to make the configuration gap diagnosable. It guards against invoking a provider client without a complete model/provider configuration.","triggerScenarios":"runArtistTask with no configured artistry model: modelId or providerId resolves to ''/undefined — e.g. no default model selected for the artistry module, or the chosen provider was deleted from the providers store.","commonSituations":"Fresh install where the user never configured an image/LLM provider; a provider entry removed or renamed while the artistry module still points at it; settings sync bringing incomplete provider config into a new window.","solutions":["Configure the artistry model and provider in settings (select both a model id and provider id) before running artist tasks.","Check providersStore for the referenced provider and re-add it if it was deleted.","Add a pre-run guard in the UI that disables the run button until modelId && providerId are set.","Fix stale settings state referencing a removed provider id."],"exampleFix":"// before\nawait runArtistTask(input) // throws when no model/provider configured\n// after\nif (!getArtistryModelId() || !getArtistryProviderId())\n  await openSettings('providers')\nawait runArtistTask(input)","handlingStrategy":"validation","validationCode":"const modelId = getArtistryModelId()\nconst providerId = getArtistryProviderId()\nif (!modelId || !providerId) {\n  openSettings('providers')\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runArtistTask(task)\n} catch (e) {\n  if (e.message.startsWith('Missing LLM configuration')) ui.showSetupWizard()\n  else throw e\n}","preventionTips":["Gate the run action in UI until both model and provider are configured.","Validate provider references when settings load and surface broken links.","Clean up module config when a provider is deleted from the store."],"tags":["llm","provider","configuration","artistry"],"backgroundTag":"missing-required-config-field","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"}