tinyhumansai/openhuman · error

URL cannot be empty

Error message

URL cannot be empty

What it means

Guard in BrowserOpenTool::validate_url rejecting an empty or whitespace-only URL string before any parsing or policy checks. It fires when the caller passes a blank `url` argument to the browser_open tool; the tool only opens pre-approved HTTPS URLs, so there is nothing to open. Fix: supply a non-empty https:// URL.

Source

Thrown at src/openhuman/tools/impl/browser/browser_open.rs:25

/// Open approved HTTPS URLs in Brave Browser (no scraping, no DOM automation).
pub struct BrowserOpenTool {
    security: Arc<SecurityPolicy>,
    allowed_domains: Vec<String>,
}

impl BrowserOpenTool {
    pub fn new(security: Arc<SecurityPolicy>, allowed_domains: Vec<String>) -> Self {
        Self {
            security,
            allowed_domains: normalize_allowed_domains(allowed_domains),
        }
    }

    fn validate_url(&self, raw_url: &str) -> anyhow::Result<String> {
        let url = raw_url.trim();

        if url.is_empty() {
            anyhow::bail!("URL cannot be empty");
        }

        if url.chars().any(char::is_whitespace) {
            anyhow::bail!("URL cannot contain whitespace");
        }

        if !url.starts_with("https://") {
            anyhow::bail!("Only https:// URLs are allowed");
        }

        if self.allowed_domains.is_empty() {
            anyhow::bail!(
                "Browser tool is enabled but no allowed_domains are configured. Add [browser].allowed_domains in config.toml"
            );
        }

        let host = extract_host(url)?;

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide a concrete https:// URL to open.
  2. Fix the argument source that yielded the blank value.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/tools/impl/browser/browser_open.rs:25 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/03dd663cf96c79b8. Report an issue: GitHub.