{"record":{"id":"46ff7374c90c59e5","repo":"mastra-ai/mastra","slug":"no-adapter-registered-for-platform-channel-plat","errorCode":null,"errorMessage":"No adapter registered for platform \"${channel.platform}\"","messagePattern":"No adapter registered for platform \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/channels/agent-channels.ts","lineNumber":948,"sourceCode":"    if (!this.toolsEnabled) return {};\n    return this.makeChannelTools();\n  }\n\n  // ---------------------------------------------------------------------------\n  // Private\n  // ---------------------------------------------------------------------------\n\n  /**\n   * Resolve the adapter for the current conversation from request context.\n   */\n  private getAdapterFromContext(context: { requestContext?: RequestContext }): { adapter: Adapter; threadId: string } {\n    const channel = context.requestContext?.get('channel') as ChannelContext | undefined;\n    if (!channel?.platform || !channel?.threadId) {\n      throw new Error('No channel context — cannot determine platform or thread');\n    }\n    const adapter = this.adapters[channel.platform];\n    if (!adapter) {\n      throw new Error(`No adapter registered for platform \"${channel.platform}\"`);\n    }\n    return { adapter, threadId: channel.threadId };\n  }\n\n  /**\n   * Derive the three per-event shapes we hand off to downstream systems from one set of\n   * inputs. Keeping this in one place ensures the LLM (`attributes`), input processors\n   * (`requestContext`), and memory (`metadata`) all see consistent author / thread facts.\n   *\n   *   - `channelContext` — goes on `requestContext` under the 'channel' key, consumed by\n   *     `ChatChannelProcessor` and other input processors.\n   *   - `attributes` — serialized as XML on the user message element the LLM sees (e.g. on\n   *     `<user messageId=... authorId=... />`). Strings only.\n   *   - `providerOptions` — written to the stored message's `content.providerMetadata`\n   *     under `mastra.channels.<platform>` so UI/query callers can read author/channel\n   *     facts off the message (e.g. show a Slack icon + author name) without unpacking\n   *     the signal envelope. The LLM ignores `providerOptions.mastra.*` since only\n   *     provider-keyed entries (openai, anthropic, …) are forwarded to the model.","sourceCodeStart":930,"sourceCodeEnd":966,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/channels/agent-channels.ts#L930-L966","documentation":"After finding a channel context in RequestContext, getAdapterFromContext looks up this.adapters[channel.platform]. If the platform name from the context is not a registered adapter, it throws this error distinguishing it from the missing-context case: context exists, but no adapter handles that platform.","triggerScenarios":"RequestContext 'channel' key present with a platform value that has no entry in the AgentChannels adapters map — e.g. typo'd platform string, adapter registered under a different key, or context produced by a different channels configuration.","commonSituations":"Renaming adapter registration keys while old messages/contexts still carry the previous platform name; multiple channels instances with different adapter sets; hand-crafted context objects with wrong platform values.","solutions":["Register an adapter under the exact platform name present in the channel context","Log/inspect the context's channel.platform and align adapter keys with it","Normalize platform names (e.g. lowercase) when setting the channel context"],"exampleFix":"// before\nctx.set('channel', { platform: 'Slack', threadId: 'C1' }); // adapters keyed 'slack'\n// after\nctx.set('channel', { platform: 'slack', threadId: 'C1' });","handlingStrategy":"validation","validationCode":"const channel = ctx?.get('channel') as ChannelContext | undefined;\nif (channel?.platform && !(channel.platform in channels.adapters)) {\n  logger.warn(`Unknown platform in context: ${channel.platform}`);\n  return;\n}","typeGuard":"function isKnownPlatform(p: string, adapters: Record<string, unknown>): p is keyof typeof adapters {\n  return p in adapters;\n}","tryCatchPattern":"try {\n  await channels.reply(message, { requestContext: ctx });\n} catch (err) {\n  if (err instanceof Error && /No adapter registered for platform/.test(err.message)) {\n    logger.error({ platform: ctx.get('channel')?.platform }, 'platform not registered');\n  } else throw err;\n}","preventionTips":["Normalize platform names to lowercase keys","Share one PLATFORMS constant across context producers and adapter registration","Add a registration test asserting every platform your integrations emit has an adapter"],"tags":["channels","adapter","request-context"],"backgroundTag":"missing-adapter-registration","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}