{"record":{"id":"3b1068b0254701cd","repo":"nanocoai/nanoclaw","slug":"no-messaging-group-for-channeltype-platformid","errorCode":null,"errorMessage":"no messaging group for ${channelType} ${platformId} — create + wire it first","messagePattern":"no messaging group for (.+?) (.+?) — create \\+ wire it first","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/messaging-groups.ts","lineNumber":107,"sourceCode":"    const isGroup = Number(values.is_group ?? 0) === 1;\n    values.unknown_sender_policy = resolveUnknownSenderPolicy(channelKey, isGroup, channelType);\n  },\n  customOperations: {\n    send: {\n      access: 'approval',\n      description:\n        'Inject a message into a messaging group as if a sender posted it, waking the wired agent — used to send a welcome on first wire. Use --channel-type, --platform-id, --text, optionally --instance, --sender-id, --sender.',\n      handler: async (args) => {\n        const channelType = args.channel_type as string;\n        const platformId = args.platform_id as string;\n        const text = args.text as string;\n        if (!channelType || !platformId || !text) {\n          throw new Error('--channel-type, --platform-id and --text are required');\n        }\n        const instance = (args.instance as string) ?? channelType;\n        const mg = await getMessagingGroupByPlatform(channelType, platformId, instance);\n        if (!mg) {\n          throw new Error(`no messaging group for ${channelType} ${platformId} — create + wire it first`);\n        }\n        // Build the same InboundEvent the CLI admin transport (src/channels/cli.ts)\n        // emits for a routed message, and route it in-process. The sender id should\n        // be a wired user (e.g. the owner just granted) so the access gate passes.\n        await routeInbound({\n          channelType,\n          instance,\n          platformId,\n          threadId: platformId,\n          message: {\n            id: `send-${randomUUID()}`,\n            kind: 'chat',\n            timestamp: new Date().toISOString(),\n            content: JSON.stringify({\n              text,\n              sender: (args.sender as string) ?? 'cli',\n              senderId: (args.sender_id as string) ?? 'cli:local',\n            }),","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/messaging-groups.ts#L89-L125","documentation":"Thrown by `ncl messaging-groups inject` when getMessagingGroupByPlatform(channelType, platformId, instance) returns null — no messaging_groups row matches that channel/platform/instance combination. The injection path requires the group to already exist and be wired before a message can be routed.","triggerScenarios":"Injecting before creating the messaging group and its wiring; wrong platform id; the group lives under a different instance name (instance defaults to channelType).","commonSituations":"Trying to send a first-wire welcome before the wiring step completed; platform id copied from a different chat; instance-specific adapters where the install uses a named instance.","solutions":["List what exists: `ncl messaging-groups list` and compare channel_type/platform_id/instance","Create and wire the group (setup wizard or `ncl messaging-groups create` + `ncl wirings create`), then re-inject","If the adapter uses a named instance, pass --instance explicitly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const mg = await getMessagingGroupByPlatform(channelType, platformId, instance); if (!mg) throw new Error('create + wire the messaging group before injecting');","typeGuard":null,"tryCatchPattern":"Catch the 'no messaging group' error and fall back to creating/wiring the group, then retry once.","preventionTips":["Complete creation and wiring before any inject","Default instance matches channelType — only override when the adapter is named"],"tags":["cli","not-found","messaging-groups","wiring"],"backgroundTag":"entity-not-found","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}