{"record":{"id":"d6272fa2e2584c68","repo":"JuliusBrussee/caveman","slug":"caveman-build-agent-definition-contains-an-unsupp","errorCode":null,"errorMessage":"caveman build: agent definition contains an unsupported value","messagePattern":"caveman build: agent definition contains an unsupported value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/agent/src/build.ts","lineNumber":582,"sourceCode":"export function toolDefinitionSHA256(tool: ToolDefinition): string {\n  return sha256(stableStringify(lockableValue(tool, new WeakSet<object>())));\n}\n\nexport function contextIRSHA256(contextIR: ContextIR): string {\n  return sha256(stableStringify(contextIRToWire(contextIR)));\n}\n\nfunction lockableValue(value: unknown, seen: WeakSet<object>): unknown {\n  if (value === null || typeof value === \"string\" || typeof value === \"boolean\" ||\n      typeof value === \"number\") {\n    return value;\n  }\n  if (typeof value === \"bigint\") return { cave_bigint: value.toString() };\n  if (typeof value === \"function\" || typeof value === \"undefined\" || typeof value === \"symbol\") {\n    return undefined;\n  }\n  if (typeof value !== \"object\") {\n    throw new Error(\"caveman build: agent definition contains an unsupported value\");\n  }\n  if (seen.has(value)) throw new Error(\"caveman build: cyclic agent definition is not lockable\");\n  seen.add(value);\n  try {\n    if (Array.isArray(value)) {\n      return value.map((item) => lockableValue(item, seen) ?? null);\n    }\n    const projected: Record<string, unknown> = {};\n    for (const [key, item] of Object.entries(value)) {\n      const locked = lockableValue(item, seen);\n      if (locked !== undefined) projected[key] = locked;\n    }\n    const implementationSource = Reflect.get(\n      value,\n      Symbol.for(\"@caveman-ai/agent:tool-implementation-source\"),\n    );\n    if (typeof implementationSource === \"string\") {\n      projected.cave_tool_implementation_sha256 = sha256(implementationSource);","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/packages/agent/src/build.ts#L564-L600","documentation":"Error \"caveman build: agent definition contains an unsupported value\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at packages/agent/src/build.ts:582 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the unsupported value from the agent definition; only canonically serializable values are lockable."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}