JuliusBrussee/caveman · error · ValueError

assembly slot {slot.id!r} content is not JSON-serializable

Error message

assembly slot {slot.id!r} content is not JSON-serializable

What it means

Error "assembly slot {slot.id!r} content is not JSON-serializable" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/sdk/python/caveman_cloud/core.py:434

            raise ValueError("assemble requires model and session_id")
        if options.emit_cache_hints not in {"gateway", "self", "none"}:
            raise ValueError(f"unknown emit_cache_hints value {options.emit_cache_hints!r}")

        ids: set[str] = set()
        normalized: list[AssemblySlot] = []
        for slot in options.slots:
            if not slot.id or slot.id in ids:
                raise ValueError(f"assembly slot id must be non-empty and unique: {slot.id!r}")
            ids.add(slot.id)
            if slot.stability not in {"stable", "session", "volatile"}:
                raise ValueError(
                    f"assembly slot {slot.id!r} has unknown stability {slot.stability!r}"
                )
            try:
                content_json = _canonical_json(slot.content)
                content = json.loads(content_json)
            except (TypeError, ValueError):
                raise ValueError(
                    f"assembly slot {slot.id!r} content is not JSON-serializable"
                ) from None
            if slot.stability != "volatile":
                key = (options.session_id, slot.id)
                content_hash = _sha256_hex(content_json)
                with self._assembly_hash_lock:
                    previous = self._assembly_hash_ledger.get(key)
                    if previous is not None and previous != content_hash:
                        raise AssemblyStabilityError(slot.id)
                    self._assembly_hash_ledger[key] = content_hash
            normalized.append(AssemblySlot(slot.id, slot.stability, content))

        ordered = [
            slot
            for stability in ("stable", "session", "volatile")
            for slot in normalized
            if slot.stability == stability
        ]

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Make the assembly slot content JSON-serializable.

When it happens

Trigger: Thrown at packages/sdk/python/caveman_cloud/core.py:434 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/780085bb4bbfe9d5. Report an issue: GitHub.