{"record":{"id":"06c7ea7e198cb294","repo":"nanocoai/nanoclaw","slug":"threads-must-be-true-or-false-got-v","errorCode":null,"errorMessage":"--threads must be true or false, got \"${v}\"","messagePattern":"--threads must be true or false, got \"(.+?)\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/wirings.ts","lineNumber":45,"sourceCode":"const 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',\n  scopeField: 'agent_group_id',\n  columns: [\n    { name: 'id', type: 'string', description: 'UUID.', generated: true },\n    {\n      name: 'messaging_group_id',\n      type: 'string',\n      description: 'The chat/channel to route from. References messaging_groups.id.',\n      required: true,\n    },","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/wirings.ts#L27-L63","documentation":"normalizeThreads only accepts true/false (booleans, or the strings/numbers '1'/'0'); anything else throws. The value is stored as INTEGER 1/0 on the wiring, NULL meaning inherit the channel declaration.","triggerScenarios":"ncl wirings create ... --threads yes / --threads on / --threads 2 — any value outside true|false|1|0 (as bool, string, or number).","commonSituations":"Passing common truthy spellings like 'yes','on','enable', or passing 'True' capitalized.","solutions":["Use --threads true or --threads false (1/0 also accepted)","Omit --threads entirely to inherit the channel declaration"],"exampleFix":"# before\nncl wirings create ... --threads yes\n# after\nncl wirings create ... --threads true","handlingStrategy":"validation","validationCode":"const ok = ['true','false','1','0'].includes(String(v));\nif (!ok) throw new Error('pass --threads true|false');","typeGuard":"function isThreadsFlag(v: unknown): boolean {\n  return [true,false,'true','false',1,0,'1','0'].includes(v as any);\n}","tryCatchPattern":null,"preventionTips":["Stick to literal true/false on the CLI","Omit the flag to inherit channel defaults"],"tags":["cli","ncl","argument-validation","threads"],"backgroundTag":"invalid-argument-value","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}