tinyhumansai/openhuman · error

dest_path must be relative — got absolute path

Error message

dest_path must be relative — got absolute path

What it means

The supplied dest_path parses as an absolute path (leading '/' or a Windows prefix), which would ignore the download root; resolve_dest rejects it to keep every download inside <workspace>/<dest_subdir>.

Source

Thrown at src/openhuman/tools/impl/network/curl.rs:60

            workspace_dir,
            dest_subdir: sanitize_dest_subdir(&dest_subdir),
            max_download_bytes,
            timeout_secs,
        }
    }

    /// Resolve a user-supplied dest path to an absolute path inside
    /// `<workspace>/<dest_subdir>`. Rejects absolute paths, `..`
    /// segments, and any other escape attempts.
    fn resolve_dest(&self, dest: &str) -> anyhow::Result<PathBuf> {
        let trimmed = dest.trim();
        if trimmed.is_empty() {
            anyhow::bail!("dest_path cannot be empty");
        }

        let p = Path::new(trimmed);
        if p.is_absolute() {
            anyhow::bail!("dest_path must be relative — got absolute path");
        }

        for component in p.components() {
            match component {
                Component::Normal(_) => {}
                Component::CurDir => {}
                Component::ParentDir => {
                    anyhow::bail!("dest_path may not contain '..'");
                }
                Component::Prefix(_) | Component::RootDir => {
                    anyhow::bail!("dest_path must be relative");
                }
            }
        }

        let root = self.workspace_dir.join(&self.dest_subdir);
        let resolved = root.join(p);

View on GitHub (pinned to 7491200858)

Solutions

  1. Pass a path relative to the downloads root, e.g. 'file.zip' or 'sub/file.zip'
  2. Let the tool choose the location and omit dest_path if no specific name is needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/tools/impl/network/curl.rs:60 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/57cb7507def249ea. Report an issue: GitHub.