JuliusBrussee/caveman · error · AssemblyStabilityError
assembly slot ${JSON.stringify(slotId)} changed after being
Error message
assembly slot ${JSON.stringify(slotId)} changed after being declared stable What it means
Error "assembly slot ${JSON.stringify(slotId)} changed after being declared stable" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/sdk/typescript/src/index.ts:1831
assemblyHashLedgers.set(cave, ledger);
}
const normalized = options.slots.map((slot) => {
if (!slot.id || ids.has(slot.id)) throw new Error(`assembly slot id must be non-empty and unique: ${JSON.stringify(slot.id)}`);
ids.add(slot.id);
if (!["stable", "session", "volatile"].includes(slot.stability)) {
throw new Error(`assembly slot ${JSON.stringify(slot.id)} has unknown stability ${JSON.stringify(slot.stability)}`);
}
let contentJSON: string;
try {
contentJSON = canonicalJSON(slot.content);
} catch {
throw new Error(`assembly slot ${JSON.stringify(slot.id)} content is not JSON-serializable`);
}
const contentHash = sha256Hex(contentJSON);
if (slot.stability !== "volatile") {
const key = `${options.sessionId}\0${slot.id}`;
const previous = ledger.get(key);
if (previous !== undefined && previous !== contentHash) throw new AssemblyStabilityError(slot.id);
ledger.set(key, contentHash);
}
return { ...slot, content: JSON.parse(contentJSON) as unknown };
});
const ordered = (["stable", "session", "volatile"] as const)
.flatMap((stability) => normalized.filter((slot) => slot.stability === stability));
const prefixSlots = ordered.filter((slot) => slot.stability !== "volatile");
const volatileSlots = ordered.filter((slot) => slot.stability === "volatile");
let request: Record<string, unknown>;
let prefixBytes: string;
let breakpoints: string[] = [];
if (provider === "anthropic") {
const toolsSlot = prefixSlots.find((slot) => slot.id === "tools" && Array.isArray(slot.content));
const systemSlots = prefixSlots.filter((slot) => slot !== toolsSlot);
const system = systemSlots.map((slot) => ({ type: "text", text: assemblyText(slot.content) }));View on GitHub (pinned to 27d5a3981a)
Solutions
- Do not mutate a slot after declaring it stable; create a new slot version instead.
When it happens
Trigger: Thrown at packages/sdk/typescript/src/index.ts:1831 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/562d0e6ac69cccc1.
Report an issue: GitHub.