{"record":{"id":"0faddf1ac9b8fd01","repo":"moeru-ai/airi","slug":"autonomousartist-failed-to-spawn-result-widget","errorCode":null,"errorMessage":"[AutonomousArtist] Failed to spawn Result widget","messagePattern":"\\[AutonomousArtist\\] Failed to spawn Result widget","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/stage-ui/src/stores/modules/artistry-autonomous.ts","lineNumber":318,"sourceCode":"\n            case 'widget':\n              try {\n                await invokers.addWidget({\n                  componentName: 'artistry',\n                  componentProps: {\n                    status: 'done',\n                    entryId,\n                    imageUrl: result.imageUrl || result.base64,\n                    prompt: analysis.prompt,\n                    title: analysis.title || 'Autonomous Scene',\n                    _skipIngestion: true,\n                  },\n                  size: 'm',\n                  ttlMs: 0,\n                })\n              }\n              catch (widgetErr) {\n                console.warn('[AutonomousArtist] Failed to spawn Result widget', widgetErr)\n              }\n              break\n\n            case 'bg_widget':\n            default:\n              // Both: Update background AND spawn widget\n              await cardStore.updateCard(cardId, {\n                extensions: {\n                  ...activeCard.extensions,\n                  airi: {\n                    ...activeCard.extensions.airi,\n                    modules: {\n                      ...activeCard.extensions.airi.modules,\n                      activeBackgroundId: entryId,\n                    },\n                  },\n                },\n              } as any)","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/moeru-ai/airi/blob/b6d0809ecb6421d492c4ce38aa7a76146c83269d/packages/stage-ui/src/stores/modules/artistry-autonomous.ts#L300-L336","documentation":"The autonomous artistry module wraps its 'spawn Result widget' call (a card-store widget spawn carrying status 'done', the image payload, prompt, title, _skipIngestion, size 'm', ttlMs 0) in try/catch. When the widget layer throws, only the widget is lost - the artwork was already applied to the card/background - and the caught widgetErr is logged after this prefix. This occurrence is the image-only delivery branch.","triggerScenarios":"The widget spawn promise rejects: empty image payload (neither result.imageUrl nor result.base64 present), widget/card store not initialized when the artist tick fires, renderer teardown racing the spawn, or an invalid widget payload (oversized base64, bad entryId).","commonSituations":"Art provider returning neither a hosted URL nor base64; module firing before the widget container mounts; memory pressure in the renderer; version drift between the artist module and widget store API.","solutions":["Inspect the logged widgetErr object right after the message - it is the actual spawn exception","Pre-validate that result.imageUrl || result.base64 is non-empty before the artist run reaches widget spawn","Ensure the widget/card store and its container are initialized before enabling the autonomous artist","Note the artwork itself is not lost (card/background update precedes the spawn); decide whether a manual retry is worth it","Re-run the artist tick if the failure was timing-related - later spawns usually succeed"],"exampleFix":"// before\nimageUrl: result.imageUrl || result.base64,\n\n// after\nconst image = result.imageUrl || result.base64\nif (!image) {\n  artistLog('No image payload; skipping widget spawn')\n  break\n}\n// ... imageUrl: image,","handlingStrategy":"try-catch","validationCode":"const image = result.imageUrl || result.base64\nif (!image) {\n  artistLog('No image payload; skipping widget spawn')\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await spawnResultWidget({ entryId, imageUrl: image, title: analysis.title })\n}\ncatch (widgetErr) {\n  // artwork already applied - never let widget failure break the artist tick\n  console.warn('[AutonomousArtist] Failed to spawn Result widget', widgetErr)\n}","preventionTips":["Validate image payloads before the artist tick reaches widget spawn","Ensure the widget store is initialized before enabling the autonomous artist","Keep widget spawn non-fatal by design - the card/background update is the source of truth"],"tags":["widgets","autonomous-artist","non-fatal","spawn","ui"],"backgroundTag":"widget-spawn-failed","analyzedSha":"b6d0809ecb6421d492c4ce38aa7a76146c83269d","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}