moeru-ai/airi · error · Error

No active chat provider or model configured

Error message

No active chat provider or model configured

What it means

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.

Solutions

  1. Open chat settings and select both an active chat provider and a model, then resend.
  2. Verify the chosen provider is fully configured (e.g. API key) and its models loaded.
  3. In app code, disable the send action until activeProvider && activeModel are truthy.
  4. When a provider is removed from settings, clear activeProvider/activeModel as part of that flow.
  5. In tests, seed the persisted chat settings before invoking send.

Example fix

// before
async function onSend() {
  await chatStore.send({ sessionId, text })
}

// after
const canSend = computed(() => Boolean(activeProvider.value && activeModel.value))
async function onSend() {
  if (!canSend.value) {
    toast.info('Select a chat provider and model first')
    return
  }
  await chatStore.send({ sessionId, text })
}
Defensive patterns

Strategy: validation

Validate before calling

// Gate sends on the chat settings precondition
if (!activeProvider.value || !activeModel.value) {
  toast.info('Select a chat provider and model in settings first')
  return
}
await chatStore.send({ sessionId, text })

Type guard

const canSend = computed(() => Boolean(activeProvider.value && activeModel.value))

Try / catch

try {
  await chatStore.send({ sessionId, text })
}
catch (error) {
  if (errorMessageFrom(error) === 'No active chat provider or model configured') {
    openChatSettings()
    return
  }
  throw error
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of moeru-ai/airi@438a067dde (2026-08-18). Data as JSON: /api/errors/ba3586ccbb3aaf97. Report an issue: GitHub.

Appendix: source

Thrown at packages/stage-ui/src/stores/chat.ts:416

    return [...names].map(name => ({ name }))
  }

  function appendSendError(sessionId: string, error: unknown) {
    if (!chatSession.getSessionMessagesIfLoaded(sessionId))
      return

    chatSession.appendSessionMessage(sessionId, {
      role: 'error',
      content: errorMessageFrom(error) ?? 'Unknown chat operation failure',
    })
  }

  async function executeSend(payload: ChatSendPayload): Promise<ChatSendResult> {
    const providerId = activeProvider.value
    const modelId = activeModel.value
    if (!providerId || !modelId)
      throw new Error('No active chat provider or model configured')

    if (!await chatSession.loadSession(payload.sessionId))
      throw new Error('Failed to load the target chat session')

    const messageCount = chatSession.getSessionMessages(payload.sessionId).length
    const chatProvider = await consciousnessStore.getChatProviderInstance(providerId)
    if (!chatProvider)
      throw new Error(`Failed to resolve chat provider "${providerId}"`)

    await runtime.ingest(payload.text, {
      model: modelId,
      chatProvider,
      attachments: payload.attachments,
      input: payload.input,
      replyToMessageId: payload.replyToMessageId,
      toolReferences: payload.tools,
      temperature: payload.temperature ?? consciousnessStore.activeTemperature,
      topP: payload.topP ?? consciousnessStore.activeTopP,

View on GitHub (pinned to 438a067dde)