sigoden/aichat · error

Invalid website

Error message

Invalid website '{path}'

What it means

Thrown by resolve_paths when a user-supplied path argument cannot be classified as a local file, directory, remote URL, external command (`...`), protocol path, or known special token like %%. It is a generic validation guard: the input at fault is the unrecognized 'path' string in the paths list passed from from_files.

Solutions

  1. Check the path for typos or unsupported protocol prefixes
  2. If it is a remote resource, ensure it uses a supported scheme such as http:// or https://
  3. If it is meant to run a command, wrap it in backticks (e.g. `ls -la`)
  4. Verify the file or directory exists locally if no scheme was intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/config/input.rs:416 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sigoden/aichat@82976d349a (2026-09-09). Data as JSON: /api/errors/6e94905ee7e8528f. Report an issue: GitHub.

Appendix: source

Thrown at src/config/input.rs:416

    loaders: &HashMap<String, String>,
    paths: Vec<String>,
) -> Result<ResolvePathsOutput> {
    let mut raw_paths = IndexSet::new();
    let mut local_paths = IndexSet::new();
    let mut remote_urls = IndexSet::new();
    let mut external_cmds = IndexSet::new();
    let mut protocol_paths = IndexSet::new();
    let mut with_last_reply = false;
    for path in paths {
        if path == "%%" {
            with_last_reply = true;
            raw_paths.insert(path);
        } else if path.starts_with('`') && path.len() > 2 && path.ends_with('`') {
            external_cmds.insert(path[1..path.len() - 1].to_string());
            raw_paths.insert(path);
        } else if is_url(&path) {
            if path.strip_suffix("**").is_some() {
                bail!("Invalid website '{path}'");
            }
            remote_urls.insert(path.clone());
            raw_paths.insert(path);
        } else if is_loader_protocol(loaders, &path) {
            protocol_paths.insert(path.clone());
            raw_paths.insert(path);
        } else {
            let resolved_path = resolve_home_dir(&path);
            let absolute_path = to_absolute_path(&resolved_path)
                .with_context(|| format!("Invalid path '{path}'"))?;
            local_paths.insert(resolved_path);
            raw_paths.insert(absolute_path);
        }
    }
    Ok((
        raw_paths.into_iter().collect(),
        local_paths.into_iter().collect(),
        remote_urls.into_iter().collect(),

View on GitHub (pinned to 82976d349a)