Hmbown/CodeWhale · error

registry source ' ' cannot be fetched as a plain tarball

Error message

registry source '{name}' cannot be fetched as a plain tarball

What it means

`fetch_tarball` builds candidate download URLs from an `InstallSource`, but a `Registry` source names an entry in a registry JSON, not a direct tarball location. Without registry resolution there is no URL to download, so it bails instead of guessing.

Solutions

  1. Route registry sources through `install_with_registry`/`update_with_registry` which resolve the registry entry first
  2. Use `InstallSource::DirectUrl` or `GitHubRepo` for the plain-tarball path
  3. Parse the user's source string and dispatch on its kind before fetching

Example fix

// before
let src = InstallSource::parse("registry:fmt")?;
fetch_tarball(&src, &network, MAX).await?; // bails
// after
let src = InstallSource::parse("registry:fmt")?;
install_with_registry(src, &skills_dir, MAX, &network, false, &registry_url).await?;
Defensive patterns

Strategy: type-guard

Validate before calling

match &source {
    InstallSource::Registry(_) => return Err(anyhow!("use registry install path")),
    _ => {}
}

Type guard

fn is_tarball_source(s: &InstallSource) -> bool {
    !matches!(s, InstallSource::Registry(_))
}

Prevention

When it happens

Trigger: Passing `InstallSource::Registry(name)` to `fetch_tarball` — e.g. calling tarball install/update paths with a `registry:` source string.

Common situations: Mixing up source kinds in scripts: `registry:my-skill` routed to the direct-URL installer; tooling that treats all sources uniformly without dispatching registry sources through `install_with_registry`/`update_with_registry`.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/21fb57023702fc60. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/skills/install.rs:1026

}

/// Resolve a *remote* [`InstallSource`] (GitHub repo or direct tarball URL)
/// and download the first reachable candidate under the network policy.
/// Registry sources are rejected: skill registry resolution stays inside
/// [`candidate_urls`], and the plugin install on-ramp has no registry index.
pub(crate) async fn fetch_tarball(
    source: &InstallSource,
    network: &NetworkPolicy,
    max_size: u64,
) -> Result<FetchOutcome> {
    let urls = match source {
        InstallSource::GitHubRepo(repo) => vec![
            format!("https://github.com/{repo}/archive/refs/heads/main.tar.gz"),
            format!("https://github.com/{repo}/archive/refs/heads/master.tar.gz"),
        ],
        InstallSource::DirectUrl(url) => vec![url.clone()],
        InstallSource::Registry(name) => {
            bail!("registry source '{name}' cannot be fetched as a plain tarball")
        }
    };
    Ok(
        match download_first_success(&urls, network, max_size).await? {
            DownloadOutcome::Bytes { bytes, url } => FetchOutcome::Bytes { bytes, url },
            DownloadOutcome::NeedsApproval(host) => FetchOutcome::NeedsApproval(host),
            DownloadOutcome::Denied(host) => FetchOutcome::Denied(host),
        },
    )
}

/// Resolve the source spec into one or more candidate URLs to try in order.
async fn candidate_urls(
    source: &InstallSource,
    network: &NetworkPolicy,
    registry_url: &str,
) -> Result<UrlResolution> {
    match source {

View on GitHub (pinned to 73e0f67d83)