{"record":{"id":"4fee389b10762030","repo":"headroomlabs-ai/headroom","slug":"recommendations-io-error-at-path-source","errorCode":null,"errorMessage":"recommendations IO error at {path}: {source}","messagePattern":"recommendations IO error at (.+?): (.+?)","errorType":"exception","errorClass":"RecommendationsError","httpStatus":null,"severity":"error","filePath":"crates/headroom-core/src/transforms/recommendations.rs","lineNumber":255,"sourceCode":"/// exposes the API surface.\npub fn get(\n    auth_mode: AuthMode,\n    model: &str,\n    structure_hash: &str,\n) -> Option<&'static Recommendation> {\n    load_default().lookup(auth_mode, model, structure_hash)\n}\n\n/// Errors surfaced by the loader. Marked non-exhaustive so we can add\n/// future variants without breaking callers.\n#[derive(Debug, thiserror::Error)]\n#[non_exhaustive]\npub enum RecommendationsError {\n    /// File doesn't exist on disk.\n    #[error(\"recommendations file not found: {0}\")]\n    Missing(PathBuf),\n    /// Filesystem error other than NotFound.\n    #[error(\"recommendations IO error at {path}: {source}\")]\n    Io {\n        path: PathBuf,\n        #[source]\n        source: std::io::Error,\n    },\n    /// TOML parse failure (typed wrapper for ergonomics).\n    #[error(\"recommendations TOML parse error: {0}\")]\n    Parse(#[from] toml::de::Error),\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn sample_toml() -> &'static str {\n        r#\"\n[[recommendation]]\nauth_mode = \"payg\"","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/crates/headroom-core/src/transforms/recommendations.rs#L237-L273","documentation":"The HEADROOM_STRIP_INTERNAL_HEADERS (name from STRIP_INTERNAL_HEADERS_ENV) environment variable was set to a value that is neither 'enabled', 'disabled', nor empty (internal_header_policy.py:22). Values are trimmed and lowercased before matching, so 'Enabled' works, but 'on', 'true', '1', or typos like 'diabled' raise at startup/config-resolution time.","triggerScenarios":"Setting HEADROOM_STRIP_INTERNAL_HEADERS=true (boolean-style value) in .env or docker-compose; a typo in a k8s ConfigMap; scripts that export 0/1 flags for all toggles.","commonSituations":"Teams used to boolean env vars assume 0/1 works; CI configs generated from templates that normalize all flags to true/false; renames or stale docs.","solutions":["Set the variable to exactly 'enabled' or 'disabled', or unset it (default is enabled)","Search the deployment for the variable: grep -r HEADROOM_STRIP_INTERNAL_HEADERS .env docker-compose.yml k8s/","If you intended 'false', change it to 'disabled'"],"exampleFix":"# before\nHEADROOM_STRIP_INTERNAL_HEADERS=true\n\n# after\nHEADROOM_STRIP_INTERNAL_HEADERS=enabled","handlingStrategy":"validation","validationCode":"raw = os.environ.get(\"HEADROOM_STRIP_INTERNAL_HEADERS\")\nif raw is not None and raw.strip().lower() not in (\"enabled\", \"disabled\"):\n    raise SystemExit(f\"bad HEADROOM_STRIP_INTERNAL_HEADERS={raw!r}; use enabled/disabled\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat enum env vars as words, not booleans","Validate env vars in a startup preflight step before the server boots"],"tags":["configuration","environment-variables","startup"],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}