{"record":{"id":"82d121f25b1783cb","repo":"tinyhumansai/openhuman","slug":"proxy-scope-services-requires-a-non-empty-proxy","errorCode":null,"errorMessage":"proxy.scope='services' requires a non-empty proxy.services list when proxy is enabled","messagePattern":"proxy\\.scope='services' requires a non-empty proxy\\.services list when proxy is enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/config/schema/proxy.rs","lineNumber":138,"sourceCode":"        for selector in self.normalized_services() {\n            if !is_supported_proxy_service_selector(&selector) {\n                anyhow::bail!(\n                    \"Unsupported proxy service selector '{selector}'. Use tool `proxy_config` action `list_services` for valid values\"\n                );\n            }\n        }\n\n        if self.enabled && !self.has_any_proxy_url() {\n            anyhow::bail!(\n                \"Proxy is enabled but no proxy URL is configured. Set at least one of http_proxy, https_proxy, or all_proxy\"\n            );\n        }\n\n        if self.enabled\n            && self.scope == ProxyScope::Services\n            && self.normalized_services().is_empty()\n        {\n            anyhow::bail!(\n                \"proxy.scope='services' requires a non-empty proxy.services list when proxy is enabled\"\n            );\n        }\n\n        Ok(())\n    }\n\n    pub fn should_apply_to_service(&self, service_key: &str) -> bool {\n        if !self.enabled {\n            return false;\n        }\n\n        match self.scope {\n            ProxyScope::Environment => false,\n            ProxyScope::OpenHuman => true,\n            ProxyScope::Services => {\n                let service_key = service_key.trim().to_ascii_lowercase();\n                if service_key.is_empty() {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/config/schema/proxy.rs#L120-L156","documentation":"Thrown by ProxyConfig validation during config load: proxy.enabled=true together with proxy.scope=\"services\" requires the proxy.services allow-list to be non-empty after normalization. Scope \"services\" means only listed services are routed through the proxy, so an empty list would appear enabled while proxying nothing; the validator fails fast instead of letting that state ship.","triggerScenarios":"Loading a TOML config (or env-overridden config) where [proxy] has enabled=true, scope=\"services\", and services is absent, empty, or contains only entries that normalize away (unknown service keys). Validation runs during Config load, before the app starts.","commonSituations":"Copying a proxy block from a template that omits the services list; switching scope from \"all\" to \"services\" without adding entries; trimming the services list during cleanup; env overrides enabling the proxy while the TOML keeps scope=services with no list.","solutions":["Add at least one service key to proxy.services (e.g. services = [\"llm\", \"backend\", \"updates\"]) and reload config","If everything should be proxied, set scope = \"all\" instead of \"services\"","If the proxy was enabled unintentionally, set enabled = false (or unset the env vars forcing it on)"],"exampleFix":"# before\n[proxy]\nenabled = true\nscope = \"services\"\n\n# after\n[proxy]\nenabled = true\nscope = \"services\"\nservices = [\"llm\", \"backend\", \"updates\"]","handlingStrategy":"validation","validationCode":"// Lint the proxy block before deploy/startup instead of crashing in Config::load\nlet p = &cfg.proxy;\nif p.enabled && p.scope == ProxyScope::Services && p.normalized_services().is_empty() {\n    return Err(anyhow::anyhow!(\"scope='services' needs a non-empty proxy.services list\"));\n}","typeGuard":null,"tryCatchPattern":"Wrap Config::load; when the error message mentions proxy.scope, print targeted guidance (add services entries or switch scope to \"all\") and exit non-zero before the app layer turns it into a generic startup failure.","preventionTips":["Treat [proxy] as one unit: any edit to enabled/scope must be re-read together with the services list","Keep a checked-in example [proxy] block with scope=\"services\" plus a populated services list","Run config validation (doctor / config.get) after every proxy edit"],"tags":["config","proxy","validation","startup"],"backgroundTag":"invalid-proxy-configuration","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}