{"record":{"id":"ba3586ccbb3aaf97","repo":"moeru-ai/airi","slug":"no-active-chat-provider-or-model-configured","errorCode":null,"errorMessage":"No active chat provider or model configured","messagePattern":"No active chat provider or model configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/stage-ui/src/stores/chat.ts","lineNumber":416,"sourceCode":"\n    return [...names].map(name => ({ name }))\n  }\n\n  function appendSendError(sessionId: string, error: unknown) {\n    if (!chatSession.getSessionMessagesIfLoaded(sessionId))\n      return\n\n    chatSession.appendSessionMessage(sessionId, {\n      role: 'error',\n      content: errorMessageFrom(error) ?? 'Unknown chat operation failure',\n    })\n  }\n\n  async function executeSend(payload: ChatSendPayload): Promise<ChatSendResult> {\n    const providerId = activeProvider.value\n    const modelId = activeModel.value\n    if (!providerId || !modelId)\n      throw new Error('No active chat provider or model configured')\n\n    if (!await chatSession.loadSession(payload.sessionId))\n      throw new Error('Failed to load the target chat session')\n\n    const messageCount = chatSession.getSessionMessages(payload.sessionId).length\n    const chatProvider = await consciousnessStore.getChatProviderInstance(providerId)\n    if (!chatProvider)\n      throw new Error(`Failed to resolve chat provider \"${providerId}\"`)\n\n    await runtime.ingest(payload.text, {\n      model: modelId,\n      chatProvider,\n      attachments: payload.attachments,\n      input: payload.input,\n      replyToMessageId: payload.replyToMessageId,\n      toolReferences: payload.tools,\n      temperature: payload.temperature ?? consciousnessStore.activeTemperature,\n      topP: payload.topP ?? consciousnessStore.activeTopP,","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/moeru-ai/airi/blob/438a067dde47aa0bdb46c2323d1fe293dc805218/packages/stage-ui/src/stores/chat.ts#L398-L434","documentation":"executeSend in the chat store reads the persisted activeProvider/activeModel refs and refuses to run when either is unset. This is a deliberate precondition guard: the chat runtime needs both a provider instance and a model id to ingest a turn. It fires before any session or network work, so seeing it means the chat settings were never (or no longer) populated.","triggerScenarios":"Fresh install where the user never selected a provider/model; persisted chat settings cleared (storage wipe, new browser profile, private mode); the selected provider was deleted but active refs were not reset; sending programmatically before onboarding/settings initialization completes.","commonSituations":"First-run flows that allow typing before provider setup; automated tests calling send without seeding settings; state desync after removing a provider in settings while activeProvider still points at it (then error 149 follows instead once set but unresolvable).","solutions":["Open chat settings and select both an active chat provider and a model, then resend.","Verify the chosen provider is fully configured (e.g. API key) and its models loaded.","In app code, disable the send action until activeProvider && activeModel are truthy.","When a provider is removed from settings, clear activeProvider/activeModel as part of that flow.","In tests, seed the persisted chat settings before invoking send."],"exampleFix":"// before\nasync function onSend() {\n  await chatStore.send({ sessionId, text })\n}\n\n// after\nconst canSend = computed(() => Boolean(activeProvider.value && activeModel.value))\nasync function onSend() {\n  if (!canSend.value) {\n    toast.info('Select a chat provider and model first')\n    return\n  }\n  await chatStore.send({ sessionId, text })\n}","handlingStrategy":"validation","validationCode":"// Gate sends on the chat settings precondition\nif (!activeProvider.value || !activeModel.value) {\n  toast.info('Select a chat provider and model in settings first')\n  return\n}\nawait chatStore.send({ sessionId, text })","typeGuard":"const canSend = computed(() => Boolean(activeProvider.value && activeModel.value))","tryCatchPattern":"try {\n  await chatStore.send({ sessionId, text })\n}\ncatch (error) {\n  if (errorMessageFrom(error) === 'No active chat provider or model configured') {\n    openChatSettings()\n    return\n  }\n  throw error\n}","preventionTips":["Disable the composer until a provider and model are selected.","Clear activeProvider/activeModel when the referenced provider is removed.","Seed persisted chat settings in tests before calling send.","Re-validate the refs on app startup after storage restores."],"tags":["chat","configuration","state","precondition"],"backgroundTag":"missing-configuration","analyzedSha":"438a067dde47aa0bdb46c2323d1fe293dc805218","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}