{"record":{"id":"477112d12d3fcb11","repo":"tinyhumansai/openhuman","slug":"scope-must-be-a-string","errorCode":null,"errorMessage":"'scope' must be a string","messagePattern":"'scope' must be a string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/system/proxy_config.rs","lineNumber":172,"sourceCode":"        }))?))\n    }\n\n    async fn handle_set(&self, args: &Value) -> anyhow::Result<ToolResult> {\n        let mut cfg = self.load_config_without_env()?;\n        let previous_scope = cfg.proxy.scope;\n        let mut proxy = cfg.proxy.clone();\n        let mut touched_proxy_url = false;\n\n        if let Some(enabled) = args.get(\"enabled\") {\n            proxy.enabled = enabled\n                .as_bool()\n                .ok_or_else(|| anyhow::anyhow!(\"'enabled' must be a boolean\"))?;\n        }\n\n        if let Some(scope_raw) = args.get(\"scope\") {\n            let scope = scope_raw\n                .as_str()\n                .ok_or_else(|| anyhow::anyhow!(\"'scope' must be a string\"))?;\n            proxy.scope = Self::parse_scope(scope).ok_or_else(|| {\n                anyhow::anyhow!(\"Invalid scope '{scope}'. Use environment|openhuman|services\")\n            })?;\n        }\n\n        match Self::parse_optional_string_update(args, \"http_proxy\")? {\n            MaybeSet::Set(update) => {\n                proxy.http_proxy = Some(update);\n                touched_proxy_url = true;\n            }\n            MaybeSet::Null => {\n                proxy.http_proxy = None;\n                touched_proxy_url = true;\n            }\n            MaybeSet::Unset => {}\n        }\n\n        match Self::parse_optional_string_update(args, \"https_proxy\")? {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/system/proxy_config.rs#L154-L190","documentation":"handle_set reads the optional 'scope' field; this fires when scope is present but not a string (number/array/object), before the value is matched against the allowed scopes.","triggerScenarios":"Thrown at src/openhuman/tools/impl/system/proxy_config.rs:172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass \"scope\" as a string, one of environment|openhuman|services"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}