ruvnet/ruflo · error · Error
roomLabel is required
Error message
roomLabel is required
What it means
Thrown by validateRoomLabel() when the supplied label is falsy, not a string, or empty. roomLabel is the human-facing room identifier (conventionally `#sales`, `#finance`) required by federation_bbs_register before it derives a stable roomId. The guard ensures a caller cannot register an anonymous room.
Source
Thrown at v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts:70
throw err;
}
}
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 {View on GitHub (pinned to 6b01dc5a68)
Solutions
- Always supply roomLabel as a non-empty string (e.g. `#sales`).
- Validate at the API boundary in your caller before invoking the tool.
- If the field is genuinely optional in your pipeline, default it to a deterministic value rather than leaving it empty.
Example fix
// before — field omitted
federation_bbs_register({ roomIdHint: 'x' }); // throws: roomLabel is required
// after
federation_bbs_register({ roomLabel: '#sales' }); Defensive patterns
Strategy: validation
Validate before calling
function requireRoomLabel(label: unknown): string {
if (typeof label !== 'string' || label.length === 0) {
throw new Error('roomLabel must be a non-empty string');
}
return label;
} Type guard
const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.length > 0;
Try / catch
null
Prevention
- Define a shared Zod/schema for the agentbbs tool inputs at your boundary.
- Unit-test the missing-field path so it fails at your layer, not inside the tool.
- Thread the register result fields by name to avoid typos.
When it happens
Trigger: Calling federation_bbs_register with roomLabel omitted, set to '', null, undefined, or a non-string (number/object); destructuring input where the field name was misspelled (e.g. `label` instead of `roomLabel`).
Common situations: Schema/client sent the field under a different key; integration test fixture missing the field; a runtime where roomLabel is conditionally set and the branch hit the falsy path.
Related errors
- roomId is required
- msgType is required
- roomLabel may only contain [A-Za-z0-9_.\-:/@#]
- roomId may only contain [A-Za-z0-9_.\-:/@#]
- msgType must be alnum + _ - and ≤64 chars
AI-assisted analysis of ruvnet/ruflo@6b01dc5a68 (2026-08-12).
Data as JSON: /api/errors/d7ae3af7d5acba2d.
Report an issue: GitHub.