{"record":{"id":"d0494d0e9b664470","repo":"ruvnet/ruflo","slug":"roomlabel-exceeds-128-chars","errorCode":null,"errorMessage":"roomLabel exceeds 128 chars","messagePattern":"roomLabel exceeds 128 chars","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts","lineNumber":71,"sourceCode":"  }\n}\n\nfunction degradedResult(reason: string): { success: true; degraded: true; reason: string } {\n  return { success: true, degraded: true, reason };\n}\n\nfunction resolveBasePath(input?: string): string {\n  const p = input && typeof input === 'string' && input.length > 0\n    ? input\n    : '.agentbbs';\n  if (/\\.\\.[\\\\/]|\\0/.test(p)) throw new Error('basePath contains disallowed characters');\n  const abs = isAbsolute(p) ? p : resolve(getProjectCwd(), p);\n  return abs;\n}\n\nfunction validateRoomLabel(label: string): string {\n  if (!label || typeof label !== 'string') throw new Error('roomLabel is required');\n  if (label.length > 128) throw new Error('roomLabel exceeds 128 chars');\n  // Rooms are conventionally `#sales`, `#finance`, etc. — keep `#` in the allow-list.\n  if (!/^[A-Za-z0-9_.\\-:/@#]+$/.test(label)) {\n    throw new Error('roomLabel may only contain [A-Za-z0-9_.\\\\-:/@#]');\n  }\n  return label;\n}\n\nfunction validateRoomId(roomId: string): string {\n  if (!roomId || typeof roomId !== 'string') throw new Error('roomId is required');\n  if (roomId.length > 128) throw new Error('roomId exceeds 128 chars');\n  if (!/^[A-Za-z0-9_.\\-:/@#]+$/.test(roomId)) {\n    throw new Error('roomId may only contain [A-Za-z0-9_.\\\\-:/@#]');\n  }\n  return roomId;\n}\n\nfunction ensureDir(dir: string): void {\n  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts#L53-L89","documentation":"validateRoomLabel() caps roomLabel at 128 characters; longer labels throw before validation of the character set even runs. The cap keeps room metadata and derived identifiers bounded, since the label feeds roomIdFromLabel() which appends a hash to a canonicalized label.","triggerScenarios":"Programmatically generated labels (e.g. embedding a full sentence, UUID pair, or file path into the room name) exceeding 128 chars; pasting a paragraph into a room-name field; concatenating project + topic + date strings without a length check.","commonSituations":"Auto-generated room names from ticket titles or log lines; agents constructing room labels from arbitrary document content without trimming.","solutions":["Keep labels short and human-scale (e.g. '#team-topic'); move long descriptive text into the room's first message instead of the label","Truncate or hash long generated labels before the call: label.slice(0, 128)","Add a length check in the calling layer with a clear error message pointing at the source of the long value"],"exampleFix":"// before — generated label from a ticket title can exceed 128\nconst label = `#${ticket.title}`; // 300-char title\n\n// after — bound the label\nconst label = `#${ticket.title.slice(0, 100).replace(/\\s+/g, '-')}`;","handlingStrategy":"validation","validationCode":"if (typeof label !== 'string' || label.length === 0 || label.length > 128) {\n  throw new Error('roomLabel must be 1-128 characters');\n}","typeGuard":"const isValidRoomLabelLength = (v: string): boolean => v.length > 0 && v.length <= 128;","tryCatchPattern":null,"preventionTips":["Truncate auto-generated labels (ticket titles, file names) before use","Put long descriptive text in the room's first message, not the label","Enforce the 128 cap in your UI validation with a character counter"],"tags":["validation","agentbbs","length-limit","rooms"],"backgroundTag":"parameter-length-limit","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}