ruvnet/ruflo · error · Error
roomId exceeds 128 chars
Error message
roomId exceeds 128 chars
What it means
validateRoomId() caps roomId at 128 characters, mirroring the roomLabel cap. Derived ids (canonicalized label + short hash suffix from roomIdFromLabel) stay well under the cap, so hitting this limit almost always means a hand-constructed or externally generated id was passed instead of one produced by the tool.
Source
Thrown at v3/@claude-flow/cli/src/mcp-tools/agentbbs-tools.ts:81
: '.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 });
}
function roomIdFromLabel(label: string): string {
// Stable, deterministic roomId — strip leading `#`, lowercase, and append a
// short hash so we don't collide across two rooms with the same canonical
// label but different policies. Phase 1: deterministic over (label).
const norm = label.replace(/^#/, '').toLowerCase();
const h = createHash('sha256').update(`agentbbs:room:${norm}`).digest('hex').slice(0, 8);
return `${norm}-${h}`;
}View on GitHub (pinned to fa13ee4ad6)
Solutions
- Use the roomId returned by agentbbs create/resolve calls rather than fabricating one
- If you must construct ids, derive them the same way: canonical label + short hash, well under 128 chars
- Add a length assertion in your calling code so overlong ids fail with your context, not deep inside the tool
Example fix
// before — hand-built id exceeds the cap
await callMCPTool('agentbbs_read', { roomId: `${tenant}-${project}-${fullPath}-${uuid}` });
// after — use the tool-derived id
await callMCPTool('agentbbs_read', { roomId: room.roomId }); Defensive patterns
Strategy: validation
Validate before calling
if (typeof id !== 'string' || id.length === 0 || id.length > 128) {
throw new Error('roomId must be 1-128 characters');
} Type guard
const isValidRoomIdLength = (v: string): boolean => v.length > 0 && v.length <= 128;
Prevention
- Tool-derived ids are always short — an overlong id means you built it yourself
- Hash or truncate external identifiers before mapping them to roomIds
- Assert id length in integration code so failures carry your context
When it happens
Trigger: Passing a UUID-plus-path composite, a base64 blob, or a whole label string unhashèd as roomId; generating ids with a scheme that concatenates many segments; copy-paste errors that paste a message envelope id instead of a room id.
Common situations: Custom integrations minting their own room ids instead of using the tool-returned ones; log/artifact parsers extracting the wrong field as the id.
Related errors
- roomLabel exceeds 128 chars
- roomLabel is required
- roomLabel may only contain [A-Za-z0-9_.\\-:/@#]
- roomId is required
- roomId may only contain [A-Za-z0-9_.\\-:/@#]
AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18).
Data as JSON: /api/errors/552d1b56b8339ac9.
Report an issue: GitHub.