ruvnet/ruflo · error · Error

roomLabel exceeds 128 chars

Error message

roomLabel exceeds 128 chars

What it means

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.

Source

Thrown at v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts:71

  }
}

function degradedResult(reason: string): { success: true; degraded: true; reason: string } {
  return { success: true, degraded: true, reason };
}

function resolveBasePath(input?: string): string {
  const p = input && typeof input === 'string' && input.length > 0
    ? input
    : '.agentbbs';
  if (/\.\.[\\/]|\0/.test(p)) throw new Error('basePath contains disallowed characters');
  const abs = isAbsolute(p) ? p : resolve(getProjectCwd(), p);
  return abs;
}

function validateRoomLabel(label: string): string {
  if (!label || typeof label !== 'string') throw new Error('roomLabel is required');
  if (label.length > 128) throw new Error('roomLabel exceeds 128 chars');
  // Rooms are conventionally `#sales`, `#finance`, etc. — keep `#` in the allow-list.
  if (!/^[A-Za-z0-9_.\-:/@#]+$/.test(label)) {
    throw new Error('roomLabel may only contain [A-Za-z0-9_.\\-:/@#]');
  }
  return label;
}

function validateRoomId(roomId: string): string {
  if (!roomId || typeof roomId !== 'string') throw new Error('roomId is required');
  if (roomId.length > 128) throw new Error('roomId exceeds 128 chars');
  if (!/^[A-Za-z0-9_.\-:/@#]+$/.test(roomId)) {
    throw new Error('roomId may only contain [A-Za-z0-9_.\\-:/@#]');
  }
  return roomId;
}

function ensureDir(dir: string): void {
  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Keep labels short and human-scale (e.g. '#team-topic'); move long descriptive text into the room's first message instead of the label
  2. Truncate or hash long generated labels before the call: label.slice(0, 128)
  3. Add a length check in the calling layer with a clear error message pointing at the source of the long value

Example fix

// before — generated label from a ticket title can exceed 128
const label = `#${ticket.title}`; // 300-char title

// after — bound the label
const label = `#${ticket.title.slice(0, 100).replace(/\s+/g, '-')}`;
Defensive patterns

Strategy: validation

Validate before calling

if (typeof label !== 'string' || label.length === 0 || label.length > 128) {
  throw new Error('roomLabel must be 1-128 characters');
}

Type guard

const isValidRoomLabelLength = (v: string): boolean => v.length > 0 && v.length <= 128;

Prevention

When it happens

Trigger: 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.

Common situations: Auto-generated room names from ticket titles or log lines; agents constructing room labels from arbitrary document content without trimming.

Related errors


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/d0494d0e9b664470. Report an issue: GitHub.