{"record":{"id":"c1a024e86e88d10b","repo":"paperclipai/paperclip","slug":"slack-receipt-runtime-unavailable","errorCode":null,"errorMessage":"Slack receipt runtime unavailable","messagePattern":"Slack receipt runtime unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/chat-sdk-runtime.ts","lineNumber":2789,"sourceCode":"  ) {\n    if (this.provider !== \"github\" || !this.githubReceiptApp)\n      throw new Error(\"GitHub receipt runtime unavailable\");\n    return applyGitHubReceiptReaction(\n      this.adapter,\n      this.githubReceiptApp.appId,\n      this.githubReceiptApp.installationId,\n      input,\n      assertCurrent,\n      fetchImpl,\n    );\n  }\n\n  async applySlackReceiptReaction(\n    input: SlackReceiptMutation,\n    fetchImpl?: typeof globalThis.fetch,\n  ): Promise<void> {\n    if (this.provider !== \"slack\" || !this.slackReceiptBotToken)\n      throw new Error(\"Slack receipt runtime unavailable\");\n    await applySlackReceiptReaction(\n      { ...input, botToken: this.slackReceiptBotToken },\n      fetchImpl,\n    );\n  }\n\n  async sendTelegramCallbackNotice(\n    receipt: TelegramCallbackReceipt,\n    text: string,\n    fetchImpl?: typeof globalThis.fetch,\n  ): Promise<{ id: string; threadId: string }> {\n    if (\n      this.provider !== \"telegram\" ||\n      !this.telegramEphemeralBotToken ||\n      receipt.companyId !== this.companyId ||\n      receipt.endpointId !== this.endpointId\n    ) {\n      throw Object.assign(","sourceCodeStart":2771,"sourceCodeEnd":2807,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/chat-sdk-runtime.ts#L2771-L2807","documentation":"applySlackReceiptReaction applies a Slack receipt reaction using the Slack bot token captured on the runtime. The wrapper throws 'Slack receipt runtime unavailable' when the runtime's provider is not 'slack' or no slackReceiptBotToken was provided at construction. It prevents Slack-specific mutations from running on runtimes lacking Slack credentials.","triggerScenarios":"Calling applySlackReceiptReaction when this.provider !== 'slack', or when this.slackReceiptBotToken is null/undefined because no Slack bot token (e.g. SLACK_BOT_TOKEN / xoxb- token) was supplied to the runtime.","commonSituations":"Slack app not installed or bot token omitted from env; receipt worker accidentally paired with a Teams/Telegram endpoint; token rotated/removed and the runtime rebuilt without it.","solutions":["Confirm the endpoint provider is 'slack' before calling this method","Set the Slack bot token in configuration/env so the runtime is constructed with slackReceiptBotToken","Restart/rebuild the runtime after adding the token so it is picked up","Route the mutation to the Slack runtime instance instead of a non-Slack one"],"exampleFix":"// before\nawait runtime.applySlackReceiptReaction(input);\n// after\nif (runtime.provider === 'slack') {\n  await runtime.applySlackReceiptReaction(input);\n}","handlingStrategy":"validation","validationCode":"if (runtime.provider !== 'slack' || !runtime.slackReceiptBotToken) throw new Error('Slack receipt requires slack runtime with bot token');","typeGuard":"const canApplySlackReceipt = (r: ChatSdkRuntime): boolean => r.provider === 'slack';","tryCatchPattern":"try { await runtime.applySlackReceiptReaction(input); } catch (e) { if ((e as Error).message === 'Slack receipt runtime unavailable') { /* skip receipt or reconfigure runtime */ } else throw e; }","preventionTips":["Set the Slack bot token (xoxb-) in env before starting endpoints","Pair Slack receipt work only with slack-provider runtimes","Alert on endpoints whose provider is slack but whose runtime lacks a bot token"],"tags":["slack","receipts","provider-mismatch","missing-credentials"],"backgroundTag":"missing-credentials","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}