{"record":{"id":"38f513c397cdd7e4","repo":"tinyhumansai/openhuman","slug":"field-must-be-a-string-or-null","errorCode":null,"errorMessage":"'{field}' must be a string or null","messagePattern":"'(.+?)' must be a string or null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/system/proxy_config.rs","lineNumber":102,"sourceCode":"            }\n            return Ok(out);\n        }\n\n        anyhow::bail!(\"'{field}' must be a string or string[]\")\n    }\n\n    fn parse_optional_string_update(args: &Value, field: &str) -> anyhow::Result<MaybeSet<String>> {\n        let Some(raw) = args.get(field) else {\n            return Ok(MaybeSet::Unset);\n        };\n\n        if raw.is_null() {\n            return Ok(MaybeSet::Null);\n        }\n\n        let value = raw\n            .as_str()\n            .ok_or_else(|| anyhow::anyhow!(\"'{field}' must be a string or null\"))?\n            .trim()\n            .to_string();\n\n        let output = if value.is_empty() {\n            MaybeSet::Null\n        } else {\n            MaybeSet::Set(value)\n        };\n        Ok(output)\n    }\n\n    fn env_snapshot() -> Value {\n        json!({\n            \"HTTP_PROXY\": std::env::var(\"HTTP_PROXY\").ok(),\n            \"HTTPS_PROXY\": std::env::var(\"HTTPS_PROXY\").ok(),\n            \"ALL_PROXY\": std::env::var(\"ALL_PROXY\").ok(),\n            \"NO_PROXY\": std::env::var(\"NO_PROXY\").ok(),\n        })","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/system/proxy_config.rs#L84-L120","documentation":"parse_optional_string_update maps the field's presence to MaybeSet: absent=Unset, null=Null, string=Set. This fires when the value is neither null nor a string (e.g. a number or object passed for proxy_url), rejecting the ambiguous shape before any config write.","triggerScenarios":"Thrown at src/openhuman/tools/impl/system/proxy_config.rs:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a plain string for the field, or JSON null to explicitly clear it","Omit the field entirely to leave it unchanged"],"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-14T05:17:10.506Z"}