{"record":{"id":"3bb147dba3d3f516","repo":"JuliusBrussee/caveman","slug":"unknown-emit-cache-hints-value-options-emit-cache-hints-r","errorCode":null,"errorMessage":"unknown emit_cache_hints value {options.emit_cache_hints!r}","messagePattern":"unknown emit_cache_hints value (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/sdk/python/caveman_cloud/core.py","lineNumber":440,"sourceCode":"        \"\"\"\n        return RetryLoopBreaker(threshold=threshold)\n\n    def assemble(self, options: AssembleOptions) -> AssemblyResult:\n        \"\"\"Build a provider request with stable/session content above volatile.\n\n        Pure client-side: no account and no network call. The hash ledger is\n        in-process and scoped by ``session_id``; deterministic slot content\n        across processes remains the builder's obligation.\n\n        ``emit_cache_hints=\"gateway\"`` (default) emits no provider hint so the\n        gateway optimizer retains attribution. ``\"self\"`` places provider\n        hints for direct calls but mints nothing.\n        \"\"\"\n        provider = options.provider.strip().lower()\n        if not options.model or not options.session_id:\n            raise ValueError(\"assemble requires model and session_id\")\n        if options.emit_cache_hints not in {\"gateway\", \"self\", \"none\"}:\n            raise ValueError(f\"unknown emit_cache_hints value {options.emit_cache_hints!r}\")\n\n        ids: set[str] = set()\n        normalized: list[AssemblySlot] = []\n        for slot in options.slots:\n            if not slot.id or slot.id in ids:\n                raise ValueError(f\"assembly slot id must be non-empty and unique: {slot.id!r}\")\n            ids.add(slot.id)\n            if slot.stability not in {\"stable\", \"session\", \"volatile\"}:\n                raise ValueError(\n                    f\"assembly slot {slot.id!r} has unknown stability {slot.stability!r}\"\n                )\n            try:\n                content_json = _canonical_json(slot.content)\n                content = json.loads(content_json)\n            except (TypeError, ValueError):\n                raise ValueError(\n                    f\"assembly slot {slot.id!r} content is not JSON-serializable\"\n                ) from None","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/sdk/python/caveman_cloud/core.py#L422-L458","documentation":"`assemble()` accepts only `emit_cache_hints` values `\"gateway\"`, `\"self\"`, or `\"none\"`. Any other string raises this ValueError naming the offending value. The field controls where provider cache hint blocks are emitted.","triggerScenarios":"Calling `assemble()` with `AssembleOptions(emit_cache_hints=...)` set to a misspelled or differently-cased value such as `\"Gateway\"`, `\"auto\"`, `True`, or `None` handled as a string.","commonSituations":"Typo after copy-paste, storing the setting in config as `\"GATEWAY\"`, or upgrading code from an older flag vocabulary.","solutions":["Set `emit_cache_hints` to one of exactly \"gateway\", \"self\", or \"none\" (lowercase).","Normalize/whitelist the value in your config layer before constructing options.","Check the docstring of `assemble()` for the current allowed set if upgrading."],"exampleFix":"// before\nopts = AssembleOptions(..., emit_cache_hints=\"Gateway\")\n// after\nopts = AssembleOptions(..., emit_cache_hints=\"gateway\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"gateway\", \"self\", \"none\"}\nassert opts.emit_cache_hints in ALLOWED, opts.emit_cache_hints","typeGuard":null,"tryCatchPattern":"try:\n    result = cave.assemble(opts)\nexcept ValueError as e:\n    opts.emit_cache_hints = \"gateway\"\n    result = cave.assemble(opts)","preventionTips":["Use string literals or an enum limited to gateway/self/none","Lowercase the value when loading from config","Add a unit test covering each allowed value"],"tags":["python","validation","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}