{"record":{"id":"cc3b3a4c4f67e692","repo":"ruvnet/ruflo","slug":"label-exceeds-256-chars","errorCode":null,"errorMessage":"label exceeds 256 chars","messagePattern":"label exceeds 256 chars","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts","lineNumber":89,"sourceCode":"  if (!path || typeof path !== 'string') throw new Error('memory path is required');\n  if (/\\.\\.[\\\\/]|\\0/.test(path)) throw new Error('memory path contains disallowed characters');\n  return isAbsolute(path) ? path : resolve(getProjectCwd(), path);\n}\n\n/**\n * Lineage manifest companion path. agenticow persists the COW chain\n * (working → checkpoints → base) into `<file>.agenticow.json` next to the\n * `.rvf` data file. Without it, forks/checkpoints are in-memory only and\n * disappear when the AgenticMemory handle closes.\n */\nexport function manifestFor(file: string): string {\n  return `${file}.agenticow.json`;\n}\n\n/** Validate a COW branch/checkpoint label (alnum + a small safe symbol set). */\nexport function validateLabel(label: string): string {\n  if (!label || typeof label !== 'string') throw new Error('label is required');\n  if (label.length > 256) throw new Error('label exceeds 256 chars');\n  if (!/^[A-Za-z0-9_.\\-:/@]+$/.test(label)) {\n    throw new Error('label may only contain [A-Za-z0-9_.\\\\-:/@]');\n  }\n  return label;\n}\n\n/**\n * Open (or create) a memory file, restoring its COW chain from the lineage\n * manifest when one exists. When neither the `.rvf` nor the manifest exists,\n * `dimension` is required to create a fresh base.\n */\nexport async function openWithLineage(api: AgenticowApi, file: string, dimension?: number) {\n  const manifest = manifestFor(file);\n  if (existsSync(manifest)) {\n    return (api.AgenticMemory as any).load(manifest);\n  }\n  const opts: any = {};\n  if (typeof dimension === 'number' && Number.isInteger(dimension) && dimension > 0) {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts#L71-L107","documentation":"Thrown by validateLabel() (agenticow-loader.ts:89) when a branch/checkpoint label is longer than 256 characters. The label is stored in the lineage manifest and used in branchPath lookups, so the loader caps it to keep manifest entries and log output bounded.","triggerScenarios":"Calling agenticow_branch / agenticow_checkpoint / agenticow_rollback / agenticow_promote, or submitting an agenticow_speculate candidate, with a label longer than 256 chars — e.g. a pasted sentence, a UUID-plus-timestamp-plus-hash composite, or a whole task description used as a label.","commonSituations":"Auto-generated labels that concatenate run metadata without truncation; LLM-driven agents using the task prompt as the label; copying a filename plus path plus description into the label field.","solutions":["Shorten the label to a human-meaningful slug under 256 chars ('run-2026-08-18-fix-auth')","Keep long data out of labels — records carry an optional numeric id and text field for payload","Truncate generated labels explicitly: label.slice(0, 256)"],"exampleFix":"// before\nconst label = `candidate-${JSON.stringify(taskContext)}-${crypto.randomUUID()}`; // way over 256 chars\nawait callTool('agenticow_branch', { path: p, label });\n\n// after\nconst label = `candidate-${Date.now()}`.slice(0, 64);\nawait callTool('agenticow_branch', { path: p, label });","handlingStrategy":"validation","validationCode":"const MAX_LABEL = 256;\nfunction fitLabel(label: string): string {\n  if (label.length > MAX_LABEL) return label.slice(0, MAX_LABEL);\n  return label;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await callTool('agenticow_branch', args);\n} catch (e) {\n  if (e instanceof Error && e.message === 'label exceeds 256 chars') {\n    args.label = args.label.slice(0, 256);\n    return callTool('agenticow_branch', args);\n  }\n  throw e;\n}","preventionTips":["Keep labels to short slugs (<64 chars); put long content in record text or your own storage","Truncate generated labels at creation time rather than relying on the server to reject them"],"tags":["validation","agenticow","memory","input-length","mcp"],"backgroundTag":"input-length-limit-exceeded","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}