{"record":{"id":"576ca61f9c14019e","repo":"moeru-ai/airi","slug":"context-bridge-spark-notify-handling-failed-usi","errorCode":null,"errorMessage":"[context-bridge] spark:notify handling failed; using fallback","messagePattern":"\\[context-bridge\\] spark:notify handling failed; using fallback","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/stage-ui/src/stores/mods/api/context-bridge.ts","lineNumber":241,"sourceCode":"        payload: options.payload,\n        ttlMs: options.ttlMs,\n        requiresAck: options.requiresAck,\n        destinations: options.destinations?.length ? options.destinations : ['character'],\n        metadata: options.metadata,\n      },\n    }\n\n    try {\n      return await characterOrchestratorStore.handleSparkNotifyWithReaction(event, {\n        fallbackText: options.fallbackResponseText,\n        forceResponse: options.forceResponse,\n        forceTextResponse: options.forceTextResponse,\n        forceSparkCommandResponse: options.forceSparkCommandResponse,\n        messageOverride: options.messageOverride,\n      })\n    }\n    catch (error) {\n      console.warn('[context-bridge] spark:notify handling failed; using fallback', error)\n      return options.fallbackResponseText\n    }\n  }\n\n  function setSparkNotifyHostRole(role: 'main' | 'client') {\n    sparkNotifyHostRole.value = role\n  }\n\n  async function dispatchSparkNotifyReaction(options: SparkNotifyReactionOptions) {\n    if (sparkNotifyHostRole.value === 'main') {\n      return await handleSparkNotifyReactionLocal(options)\n    }\n\n    const requestId = nanoid()\n    return await new Promise<string>((resolve) => {\n      const timeout = setTimeout(() => {\n        sparkNotifyBridgeWaiters.delete(requestId)\n        resolve(options.fallbackResponseText)","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/stage-ui/src/stores/mods/api/context-bridge.ts#L223-L259","documentation":"characterOrchestratorStore.handleSparkNotifyWithReaction threw while processing a spark:notify event — typically an LLM provider call, tool execution, or reaction pipeline failure. The bridge swallows the error and returns options.fallbackResponseText, so the user still receives a reply instead of a dropped notification. Only the richer reaction is lost.","triggerScenarios":"LLM provider HTTP failure (rate limit, invalid key, quota) inside the reaction pipeline; a tool executed during the reaction throwing; provider response shape changing after a runtime update and failing validation.","commonSituations":"Expired or invalid provider API key; provider rate limiting during bursts of spark notifications; orchestrator module misconfigured after an update.","solutions":["Check provider credentials/quota in settings — most failures originate at the LLM provider call","Inspect the logged error object for HTTP status (401/429/5xx) to pick the fix","Keep a meaningful fallbackResponseText so users are never left without a reply","If failures repeat for one character, review its orchestrator module configuration"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await characterOrchestratorStore.handleSparkNotifyWithReaction(event, { fallbackText: options.fallbackResponseText, forceResponse: options.forceResponse, /* ... */ })\n}\ncatch (error) {\n  console.warn('[context-bridge] spark:notify handling failed; using fallback', error)\n  return options.fallbackResponseText // conversation continues with a generic reply\n}","preventionTips":["Keep provider credentials valid; most spark:notify failures start at the LLM provider call","Make the reaction pipeline return typed errors instead of throwing raw","Always supply a non-empty fallbackResponseText","Log the provider status separately from the generic warn for faster triage"],"tags":["context-bridge","spark-notify","orchestrator","llm-provider","fallback"],"backgroundTag":"llm-provider-request-failed","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T11:17:13.642Z"}