{"record":{"id":"01fcaf9f017dd0b8","repo":"headroomlabs-ai/headroom","slug":"invalid-memory-injection-mode-env-normalized-r","errorCode":null,"errorMessage":"Invalid {MEMORY_INJECTION_MODE_ENV}={normalized!r}; expected 'live_zone_tail' or 'disabled'","messagePattern":"Invalid (.+?)=(.+?); expected 'live_zone_tail' or 'disabled'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"headroom/proxy/memory_injection_mode_policy.py","lineNumber":19,"sourceCode":"\"\"\"Memory-injection mode resolution policy.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Literal, cast\n\nMEMORY_INJECTION_MODE_ENV = \"HEADROOM_MEMORY_INJECTION_MODE\"\nMEMORY_INJECTION_MODE_DEFAULT: Literal[\"live_zone_tail\", \"disabled\"] = \"live_zone_tail\"\nMemoryInjectionMode = Literal[\"live_zone_tail\", \"disabled\"]\n\n\ndef resolve_memory_injection_mode(raw: str | None) -> MemoryInjectionMode:\n    \"\"\"Resolve the active memory-injection routing mode from an optional value.\"\"\"\n    normalized = (raw or \"\").strip().lower()\n    if not normalized:\n        return MEMORY_INJECTION_MODE_DEFAULT\n    if normalized in (\"live_zone_tail\", \"disabled\"):\n        return cast(MemoryInjectionMode, normalized)\n    raise ValueError(\n        f\"Invalid {MEMORY_INJECTION_MODE_ENV}={normalized!r}; \"\n        \"expected 'live_zone_tail' or 'disabled'\"\n    )\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/proxy/memory_injection_mode_policy.py#L1-L23","documentation":"Error \"Invalid {MEMORY_INJECTION_MODE_ENV}={normalized!r}; expected 'live_zone_tail' or 'disabled'\" thrown in headroomlabs-ai/headroom.","triggerScenarios":"Raised at startup when the memory injection mode environment variable holds an unrecognized value.","commonSituations":"See trigger scenarios.","solutions":["Set {MEMORY_INJECTION_MODE_ENV} to 'live_zone_tail' or 'disabled'","Unset the variable to use the default injection mode"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}