{"record":{"id":"1230238a0c78eda1","repo":"Hmbown/CodeWhale","slug":"the-codewhale-bundle-is-still-installed-in-dsh-pro","errorCode":null,"errorMessage":"the Codewhale bundle is still installed in DSH profile `{}`; run `{CLI_COMMAND} remove-bundle` first","messagePattern":"the Codewhale bundle is still installed in DSH profile `(.+?)`; run `(.+?) remove-bundle` first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/mod.rs","lineNumber":519,"sourceCode":"        identity_summary: Some(identity_summary(&record.identity)),\n        permission_mode: Some(record.identity.permission_mode.as_str().to_string()),\n        note: None,\n    });\n    doc.current = Some(record.clone());\n    doc.save(&paths.receipt)?;\n    crate::audit::log_sensitive_event(\n        &format!(\"integration.dsh.{}\", event.as_str()),\n        serde_json::json!({ \"overlay_path\": paths.overlay.display().to_string() }),\n    );\n    Ok(record)\n}\n\n/// Delete only Codewhale-owned files; keep the receipt history with a\n/// terminal `remove` entry. Never touches `$DSH_HOME`.\npub(crate) fn remove(paths: &DshPaths) -> Result<Vec<PathBuf>> {\n    let mut doc = DshReceiptDocument::load(&paths.receipt)?;\n    if doc.current.as_ref().is_some_and(|r| r.bundle.is_some()) {\n        anyhow::bail!(\n            \"the Codewhale bundle is still installed in DSH profile `{}`; run `{CLI_COMMAND} remove-bundle` first\",\n            bundle::BUNDLE_PROFILE\n        );\n    }\n    let mut removed = Vec::new();\n    for path in [&paths.overlay, &paths.skin, &paths.skin_preview] {\n        match std::fs::remove_file(path) {\n            Ok(()) => removed.push(path.clone()),\n            Err(error) if error.kind() == std::io::ErrorKind::NotFound => {}\n            Err(error) => return Err(error).with_context(|| format!(\"remove {}\", path.display())),\n        }\n    }\n    let previous = doc.current.take();\n    let now = now_rfc3339();\n    doc.push(DshReceiptEntry {\n        event: DshReceiptEvent::Remove,\n        at: now,\n        codewhale_version: codewhale_version(),","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/dsh/mod.rs#L501-L537","documentation":"Error \"the Codewhale bundle is still installed in DSH profile `{}`; run `{CLI_COMMAND} remove-bundle` first\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/integrations/dsh/mod.rs:519 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}