moeru-ai/airi · error · Error

No active chat provider or model configured

Error message

No active chat provider or model configured

What it means

Thrown synchronously at the start of chat store executeSend when activeProvider or activeModel is falsy. The send pipeline requires both a provider id and a model id to resolve a ChatProvider instance and call runtime.ingest; without them it cannot proceed. This is a UI-state precondition error, not a network error.

Source

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

    for (const tool of selectedTools)
      names.add(tool.name)

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

  function appendSendError(sessionId: string, error: unknown) {
    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')

    const messageCount = chatSession.getSessionMessages(payload.sessionId).length
    const chatProvider = await providerStore.getProviderInstance<ChatProvider>(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,
      toolReferences: payload.tools,
      // Resolve this function after the request reaches the per-session queue.
      // The history then contains tool names from every earlier queued turn.
      tools: async () => {
        const references = collectToolReferences(payload.sessionId, payload.tools)
        return llmToolsStore.getToolsByNames(...references.map(tool => tool.name))
      },

View on GitHub (pinned to 27111382b4)

Solutions

  1. Disable the send control until both activeProvider and activeModel are set.
  2. On startup, ensure a default provider/model is selected or prompt the user to configure one.
  3. When a provider is removed, clear activeProvider only if it matches and re-select a valid one.
  4. Catch this error in the send action and show a 'configure a provider' prompt instead of a raw error.

Example fix

// before
const providerId = activeProvider.value
const modelId = activeModel.value
if (!providerId || !modelId)
  throw new Error('No active chat provider or model configured')

// after: guard at the UI layer so executeSend is never called unprepared
// (in the component)
const canSend = computed(() => !!activeProvider.value && !!activeModel.value && payload.value.trim())
<button :disabled="!canSend" @click="send">Send</button>
Defensive patterns

Strategy: validation

Validate before calling

import { computed } from 'vue'

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

// in the send action
function send(payload: ChatSendPayload) {
  if (!canSend.value) {
    // prompt user to select/configure a provider and model
    return
  }
  return executeSend(payload)
}

Type guard

function hasActiveChatSelection(provider: unknown, model: unknown): provider is string {
  return typeof provider === 'string' && provider.length > 0
    && typeof model === 'string' && model.length > 0
}

Try / catch

try {
  return await executeSend(payload)
}
catch (error) {
  if (String(error).includes('No active chat provider or model')) {
    // open settings / prompt configuration; do not retry until resolved
  }
  throw error
}

Prevention

When it happens

Trigger: The user triggers a send (chat input submit) before selecting a provider/model, or the persisted active provider/model was cleared/expired. Also when a provider config is invalid so activeProvider becomes empty after validation, but the send button is still enabled.

Common situations: First-run with no provider configured; provider config deleted making activeProvider stale; model list not yet loaded so activeModel is empty; UI bug allowing send while selection is incomplete.

Related errors


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