{"record":{"id":"1ca499ef21b3163f","repo":"ruvnet/ruflo","slug":"roomlabel-may-only-contain-a-za-z0-9","errorCode":null,"errorMessage":"roomLabel may only contain [A-Za-z0-9_.\\\\-:/@#]","messagePattern":"roomLabel may only contain \\[A-Za-z0-9_\\.\\\\\\\\-:/@#\\]","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts","lineNumber":103,"sourceCode":"function 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 });\n}\n\nfunction roomIdFromLabel(label: string): string {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/ruvnet/ruflo/blob/9c61c86f06b439af2a95085ae9bb0ca839662e41/v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts#L85-L121","documentation":"validateRoomLabel() enforces an allow-list charset: only A-Za-z0-9, underscore, dot, hyphen, colon, slash, at-sign, and '#' pass. The '#' is deliberately allowed because rooms are conventionally named '#sales', '#finance'. Any other character — space, comma, unicode/emoji, quotes — throws with the allow-list spelled out in the message.","triggerScenarios":"Labels containing spaces ('#project alpha'), commas from list-join bugs, emojis or non-ASCII characters from user input, shell-quote characters, or HTML entities pasted from web UIs.","commonSituations":"User-typed room names in chat UIs forwarded verbatim; i18n deployments where labels contain accented characters; labels built by joining tokens with spaces instead of hyphens.","solutions":["Normalize labels before the call: lowercase, replace whitespace runs with '-', strip non-ASCII","Use the conventional form '#kebab-case-name' with only allow-listed characters","Validate at the UI/API boundary with the same regex /^[A-Za-z0-9_.\\-:/@#]+$/ so users get an early, friendly error"],"exampleFix":"// before — space in label\nawait callMCPTool('agentbbs_create_room', { roomLabel: '#project alpha' });\n\n// after — normalized\nawait callMCPTool('agentbbs_create_room', { roomLabel: '#project-alpha' });","handlingStrategy":"validation","validationCode":"const ROOM_LABEL_RE = /^[A-Za-z0-9_.\\-:/@#]+$/;\n\nfunction normalizeRoomLabel(raw: string): string {\n  const cleaned = raw.trim().replace(/\\s+/g, '-').replace(/[^A-Za-z0-9_.\\-:/@#]/g, '');\n  if (!ROOM_LABEL_RE.test(cleaned)) throw new Error(`cannot normalize label: ${raw}`);\n  return cleaned;\n}","typeGuard":"const hasAllowedRoomLabelCharset = (v: string): boolean => /^[A-Za-z0-9_.\\-:/@#]+$/.test(v);","tryCatchPattern":null,"preventionTips":["Normalize user input (lowercase, hyphens for spaces, strip non-ASCII) before the call","Adopt the '#kebab-case' convention for room names","Run the same allow-list regex at your API boundary for friendly early errors"],"tags":["validation","agentbbs","charset","sanitization","rooms"],"backgroundTag":"disallowed-characters","analyzedSha":"9c61c86f06b439af2a95085ae9bb0ca839662e41","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}