JuliusBrussee/caveman · error · Error
caveman build: cyclic agent definition is not lockable
Error message
caveman build: cyclic agent definition is not lockable
What it means
Error "caveman build: cyclic agent definition is not lockable" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/agent/src/build.ts:584
}
export function contextIRSHA256(contextIR: ContextIR): string {
return sha256(stableStringify(contextIRToWire(contextIR)));
}
function lockableValue(value: unknown, seen: WeakSet<object>): unknown {
if (value === null || typeof value === "string" || typeof value === "boolean" ||
typeof value === "number") {
return value;
}
if (typeof value === "bigint") return { cave_bigint: value.toString() };
if (typeof value === "function" || typeof value === "undefined" || typeof value === "symbol") {
return undefined;
}
if (typeof value !== "object") {
throw new Error("caveman build: agent definition contains an unsupported value");
}
if (seen.has(value)) throw new Error("caveman build: cyclic agent definition is not lockable");
seen.add(value);
try {
if (Array.isArray(value)) {
return value.map((item) => lockableValue(item, seen) ?? null);
}
const projected: Record<string, unknown> = {};
for (const [key, item] of Object.entries(value)) {
const locked = lockableValue(item, seen);
if (locked !== undefined) projected[key] = locked;
}
const implementationSource = Reflect.get(
value,
Symbol.for("@caveman-ai/agent:tool-implementation-source"),
);
if (typeof implementationSource === "string") {
projected.cave_tool_implementation_sha256 = sha256(implementationSource);
}
return projected;View on GitHub (pinned to 27d5a3981a)
Solutions
- Break the cycle in the agent/subagent definition graph; cyclic definitions cannot be locked.
When it happens
Trigger: Thrown at packages/agent/src/build.ts:584 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/82ee0637813d8aee.
Report an issue: GitHub.