Hmbown/CodeWhale · error

plugin source changed after review: expected content hash {e

Error message

plugin source changed after review: expected content hash {expected}, copied bytes hash is {actual}; nothing was installed

What it means

verify_expected_content_hash compared the staged copy's content hash against the hash recorded at review time and found a mismatch — the source changed between user review and installation. The staged copy is deleted and nothing is installed, guaranteeing only reviewed bytes land in the plugins directory.

Source

Thrown at crates/tui/src/plugins/install/mod.rs:343

                expected_content_hash,
            )
        }
    }
}

fn verify_expected_content_hash(
    staged: &stage::StagedPlugin,
    expected_content_hash: Option<&str>,
) -> Result<()> {
    let Some(expected) = expected_content_hash else {
        return Ok(());
    };
    if staged.content_hash == expected {
        return Ok(());
    }
    let actual = staged.content_hash.clone();
    let _ = fs::remove_dir_all(&staged.staged_path);
    bail!(
        "plugin source changed after review: expected content hash {expected}, copied bytes hash is {actual}; nothing was installed"
    )
}

/// Stage and finalize an already-downloaded remote tarball. Kept separate
/// from [`install`] so [`update`] can compare the checksum of the bytes it
/// already fetched instead of downloading twice.
#[allow(clippy::too_many_arguments)]
fn install_remote_bytes(
    remote: &InstallSource,
    bytes: &[u8],
    url: &str,
    user_plugins_dir: &Path,
    max_size: u64,
    update: bool,
    name_conflict: &dyn Fn(&str) -> Option<String>,
    expected_content_hash: Option<&str>,
) -> Result<PluginInstallOutcome> {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Re-review the plugin (its content genuinely changed)
  2. Then reinstall with the updated expected hash
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/tui/src/plugins/install/mod.rs:343 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/df5f2b732afb041a. Report an issue: GitHub.