{"record":{"id":"21ef2a74d500e8d0","repo":"nanocoai/nanoclaw","slug":"messaging-group-not-found-id","errorCode":null,"errorMessage":"messaging group not found: ${id}","messagePattern":"messaging group not found: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/wirings.ts","lineNumber":36,"sourceCode":"import type { MessagingGroup, MessagingGroupAgent } from '../../types.js';\nimport { registerResource } from '../crud.js';\nimport { projectDestinationsToSessions } from './destinations.js';\n\n/**\n * Pass-1 parity with the generic create: enum validation for explicit flags\n * (the custom `create` below bypasses genericCreate, which would otherwise\n * reject e.g. `--engage-mode bogus`).\n */\nconst CREATE_ENUMS: Record<string, string[]> = {\n  engage_mode: ['pattern', 'mention', 'mention-sticky'],\n  sender_scope: ['all', 'known'],\n  ignored_message_policy: ['drop', 'accumulate'],\n  session_mode: ['shared', 'per-thread', 'agent-shared'],\n};\n\nasync function requireMessagingGroup(id: unknown): Promise<MessagingGroup> {\n  const mg = await getMessagingGroup(String(id));\n  if (!mg) throw new Error(`messaging group not found: ${id}`);\n  return mg;\n}\n\n/** --threads accepts true/false (or 1/0); stored as INTEGER 1/0. Omitted =\n *  column NULL = inherit the channel declaration. */\nfunction normalizeThreads(v: unknown): number {\n  if (v === true || v === 'true' || v === '1' || v === 1) return 1;\n  if (v === false || v === 'false' || v === '0' || v === 0) return 0;\n  throw new Error(`--threads must be true or false, got \"${v}\"`);\n}\n\nregisterResource({\n  name: 'wiring',\n  plural: 'wirings',\n  table: 'messaging_group_agents',\n  description:\n    'Wiring — connects a messaging group to an agent group. Determines which agent handles messages from which chat. The same messaging group can be wired to multiple agents; the same agent can be wired to multiple messaging groups.',\n  idColumn: 'id',","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/wirings.ts#L18-L54","documentation":"Thrown by requireMessagingGroup in the ncl CLI wiring resource when a messaging group lookup by the given id returns nothing. The CLI refuses to operate on a wiring whose messaging group does not exist in the central DB.","triggerScenarios":"ncl wirings create/update/delete --messaging-group-id <id> (or any command that resolves a wiring) where <id> is not a row in messaging_groups — mistyped id, deleted group, or wrong install/DB.","commonSituations":"Copy-pasting an id from another install, referencing a messaging group deleted after channel re-wiring, or running ncl against a different socket/data dir.","solutions":["Run `ncl messaging-groups list` and copy the exact id","If the group is gone, recreate it with `ncl messaging-groups create` then retry","Verify you are connected to the right install (socket path / host)"],"exampleFix":"# before\nncl wirings delete --id abc123\n# after (find real id first)\nncl messaging-groups list\nncl wirings delete --id <real-messaging-group-id>","handlingStrategy":"validation","validationCode":"const mg = await getMessagingGroup(id);\nif (!mg) throw new Error(`no such messaging group: ${id}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always resolve ids from `ncl messaging-groups list` at call time","Script against --json output instead of hardcoding ids"],"tags":["cli","ncl","wiring","not-found","validation"],"backgroundTag":"entity-not-found","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}