moeru-ai/airi · error · Error

Failed to generate image: ${artistryResult.error || 'No outp

Error message

Failed to generate image: ${artistryResult.error || 'No output received'}

What it means

Thrown when the headless artistry generation returned an error, or returned neither base64 nor imageUrl. The message embeds the upstream artistryResult.error (or 'No output received'). This is the image_journal executor wrapping any provider-level failure (network, [40]-style config, [41]-style empty output) into a single user-facing error.

Source

Thrown at apps/stage-tamagotchi/src/renderer/stores/tools/builtin/image-journal.ts:109

  const title = params.title || `Generation ${new Date().toLocaleString()}`

  // Resolve mode: explicit param > character fallback > global default (inline)
  const spawnMode = cardArtistry?.spawnMode
  const mode = params.mode || spawnMode || 'inline'

  const { addWidget, generateHeadless } = getInvokers()

  try {
    const artistryResult = await generateHeadless({
      prompt: artistryConfig.promptPrefix ? `${artistryConfig.promptPrefix} ${params.prompt}` : params.prompt as string,
      model: artistryConfig.model as string,
      provider: artistryConfig.provider as string,
      options: JSON.parse(JSON.stringify(artistryConfig.options || {})),
      globals: JSON.parse(JSON.stringify(artistryConfig.globals || {})),
    })

    if (artistryResult.error || (!artistryResult.base64 && !artistryResult.imageUrl)) {
      throw new Error(`Failed to generate image: ${artistryResult.error || 'No output received'}`)
    }

    let blob: Blob
    if (artistryResult.base64) {
      const response = await fetch(artistryResult.base64)
      blob = await response.blob()
    }
    else {
      const response = await fetch(artistryResult.imageUrl!)
      blob = await response.blob()
    }

    const entryId = await backgroundStore.addBackground('journal', blob, title, params.prompt, cardStore.activeCardId)

    // Handle Application Logic based on Mode
    if (mode === 'bg' || mode === 'bg_widget') {
      const cardId = cardStore.activeCardId
      if (cardId) {

View on GitHub (pinned to 27111382b4)

Solutions

  1. Read the embedded artistryResult.error — it names the real upstream cause; fix that first.
  2. If error mentions a missing API key, configure the provider (see [40]).
  3. If 'No output received', retry or switch models (see [41]).
  4. Check network connectivity to the provider endpoint.
  5. Verify generateHeadless invoker wiring is correct and options/globals are not malformed.
Defensive patterns

Strategy: try-catch

Type guard

function isSuccessfulArtistryResult(r: { error?: string, base64?: string, imageUrl?: string }): boolean {
  return !r.error && (!!r.base64 || !!r.imageUrl)
}

Try / catch

try {
  await executeCreateImageJournalEntry(params)
} catch (e) {
  const msg = e instanceof Error ? e.message : String(e)
  // msg embeds the upstream cause; branch on known substrings
  if (msg.includes('Missing API Key')) { /* configure provider */ }
  else if (msg.includes('No output')) { /* retry or switch model */ }
  else throw e
}

Prevention

When it happens

Trigger: Underlying artistry provider failed: missing API key ([40]), Replicate returned no output ([41]/[43]), provider returned an error string, or the result object had no base64 and no imageUrl.

Common situations: Provider misconfigured (see [40]); upstream model failure (see [41]/[42]/[43]); network outage during generation; provider returned a partial result with only an error field.

Related errors


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