{"record":{"id":"6e095605dd0f6eec","repo":"tinyhumansai/openhuman","slug":"dest-path-must-be-relative","errorCode":null,"errorMessage":"dest_path must be relative","messagePattern":"dest_path must be relative","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/network/curl.rs","lineNumber":71,"sourceCode":"        let trimmed = dest.trim();\n        if trimmed.is_empty() {\n            anyhow::bail!(\"dest_path cannot be empty\");\n        }\n\n        let p = Path::new(trimmed);\n        if p.is_absolute() {\n            anyhow::bail!(\"dest_path must be relative — got absolute path\");\n        }\n\n        for component in p.components() {\n            match component {\n                Component::Normal(_) => {}\n                Component::CurDir => {}\n                Component::ParentDir => {\n                    anyhow::bail!(\"dest_path may not contain '..'\");\n                }\n                Component::Prefix(_) | Component::RootDir => {\n                    anyhow::bail!(\"dest_path must be relative\");\n                }\n            }\n        }\n\n        let root = self.workspace_dir.join(&self.dest_subdir);\n        let resolved = root.join(p);\n\n        // Belt-and-braces: ensure the resolved path still lives under root.\n        // Lexical check is sufficient because we already rejected `..`.\n        if !resolved.starts_with(&root) {\n            anyhow::bail!(\"dest_path resolves outside the downloads root\");\n        }\n\n        Ok(resolved)\n    }\n\n    async fn validate_url(&self, raw_url: &str) -> anyhow::Result<String> {\n        validate_url_with_dns_check(raw_url, &self.allowed_domains).await","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/network/curl.rs#L53-L89","documentation":"The relative dest_path contains a Prefix or RootDir component (typically a drive letter like C: or an embedded root slash), which cannot occur inside a genuinely relative path and is rejected by the component loop.","triggerScenarios":"Thrown at src/openhuman/tools/impl/network/curl.rs:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Strip drive letters and leading slashes from dest_path","Use a plain relative path such as 'downloads/file.zip'"],"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"}