{"record":{"id":"21fb57023702fc60","repo":"Hmbown/CodeWhale","slug":"registry-source-name-cannot-be-fetched-as-a-pl","errorCode":null,"errorMessage":"registry source '{name}' cannot be fetched as a plain tarball","messagePattern":"registry source '(.+?)' cannot be fetched as a plain tarball","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/install.rs","lineNumber":1026,"sourceCode":"}\n\n/// Resolve a *remote* [`InstallSource`] (GitHub repo or direct tarball URL)\n/// and download the first reachable candidate under the network policy.\n/// Registry sources are rejected: skill registry resolution stays inside\n/// [`candidate_urls`], and the plugin install on-ramp has no registry index.\npub(crate) async fn fetch_tarball(\n    source: &InstallSource,\n    network: &NetworkPolicy,\n    max_size: u64,\n) -> Result<FetchOutcome> {\n    let urls = match source {\n        InstallSource::GitHubRepo(repo) => vec![\n            format!(\"https://github.com/{repo}/archive/refs/heads/main.tar.gz\"),\n            format!(\"https://github.com/{repo}/archive/refs/heads/master.tar.gz\"),\n        ],\n        InstallSource::DirectUrl(url) => vec![url.clone()],\n        InstallSource::Registry(name) => {\n            bail!(\"registry source '{name}' cannot be fetched as a plain tarball\")\n        }\n    };\n    Ok(\n        match download_first_success(&urls, network, max_size).await? {\n            DownloadOutcome::Bytes { bytes, url } => FetchOutcome::Bytes { bytes, url },\n            DownloadOutcome::NeedsApproval(host) => FetchOutcome::NeedsApproval(host),\n            DownloadOutcome::Denied(host) => FetchOutcome::Denied(host),\n        },\n    )\n}\n\n/// Resolve the source spec into one or more candidate URLs to try in order.\nasync fn candidate_urls(\n    source: &InstallSource,\n    network: &NetworkPolicy,\n    registry_url: &str,\n) -> Result<UrlResolution> {\n    match source {","sourceCodeStart":1008,"sourceCodeEnd":1044,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/skills/install.rs#L1008-L1044","documentation":"`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.","triggerScenarios":"Passing `InstallSource::Registry(name)` to `fetch_tarball` — e.g. calling tarball install/update paths with a `registry:` source string.","commonSituations":"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`.","solutions":["Route registry sources through `install_with_registry`/`update_with_registry` which resolve the registry entry first","Use `InstallSource::DirectUrl` or `GitHubRepo` for the plain-tarball path","Parse the user's source string and dispatch on its kind before fetching"],"exampleFix":"// before\nlet src = InstallSource::parse(\"registry:fmt\")?;\nfetch_tarball(&src, &network, MAX).await?; // bails\n// after\nlet src = InstallSource::parse(\"registry:fmt\")?;\ninstall_with_registry(src, &skills_dir, MAX, &network, false, &registry_url).await?;","handlingStrategy":"type-guard","validationCode":"match &source {\n    InstallSource::Registry(_) => return Err(anyhow!(\"use registry install path\")),\n    _ => {}\n}","typeGuard":"fn is_tarball_source(s: &InstallSource) -> bool {\n    !matches!(s, InstallSource::Registry(_))\n}","tryCatchPattern":null,"preventionTips":["Dispatch on InstallSource kind before choosing a fetch strategy","Never assume all source strings fetch the same way","Route registry: sources only through registry APIs"],"tags":["skills","registry","unsupported-operation"],"backgroundTag":"incompatible-source-type","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}