{"record":{"id":"24bc76f6488184b9","repo":"tonhowtf/omniget","slug":"whisper-cli-sumiu-depois-de-mover-a-pasta","errorCode":null,"errorMessage":"whisper-cli sumiu depois de mover a pasta","messagePattern":"whisper-cli sumiu depois de mover a pasta","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/whisper.rs","lineNumber":231,"sourceCode":"    tracing::info!(\"[whisper] baixando {} ({})\", asset.name, asset.tag);\n    let data = github::download(&client, &asset, false, &progress, \"whisper-cli\").await?;\n    let staging = dir.with_extension(\"new\");\n    let _ = std::fs::remove_dir_all(&staging);\n    let staging_c = staging.clone();\n    let asset_name_c = asset.name.clone();\n    tokio::task::spawn_blocking(move || github::unpack(&data, &asset_name_c, &staging_c))\n        .await\n        .map_err(|e| anyhow!(\"Spawn blocking failed: {}\", e))??;\n    let Some(exe) = github::find_file(&staging, &bin_name(\"whisper-cli\")) else {\n        let _ = std::fs::remove_dir_all(&staging);\n        return Err(anyhow!(\"o pacote baixado nao contem o whisper-cli\"));\n    };\n    github::make_executable(&exe);\n    // As libs (.dll/.so) ficam ao lado do executável no mesmo pacote.\n    github::swap_dir(&staging, &dir)?;\n    github::strip_quarantine(&dir).await;\n    let final_exe = github::find_file(&dir, &bin_name(\"whisper-cli\"))\n        .ok_or_else(|| anyhow!(\"whisper-cli sumiu depois de mover a pasta\"))?;\n    std::fs::write(dir.join(\"VERSION\"), &asset.tag).ok();\n    Ok(final_exe)\n}\n\n#[derive(Debug, Clone, Deserialize)]\npub struct TranscribeOptions {\n    pub input: String,\n    pub model: String,\n    /// \"auto\" ou código ISO (\"pt\", \"en\").\n    pub language: String,\n    /// Traduzir a saída para inglês (recurso nativo do Whisper).\n    #[serde(default)]\n    pub translate: bool,\n    /// Tamanho máximo de segmento em caracteres (0 = deixar o modelo decidir).\n    #[serde(default)]\n    pub max_len: u32,\n    #[serde(default)]\n    pub prompt: String,","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/whisper.rs#L213-L249","documentation":"install() finishes by swapping the staging dir into place (github::swap_dir) and then re-searching for whisper-cli in the final directory. If the executable cannot be found after the move, this internal-invariant error is returned — the swap somehow lost the binary that was just verified in staging.","triggerScenarios":"github::find_file(&dir, bin_name(\"whisper-cli\")) returns None after swap_dir succeeded — e.g. the swap silently moved/renamed the directory, antivirus/quarantine interference, or a partially failed filesystem operation on the destination.","commonSituations":"Antivirus or macOS Gatekeeper moving/blocking files right after extraction; the destination dir existing in a stale state so swap_dir falls back to a non-atomic copy that fails partially; filesystem sync issues on network mounts.","solutions":["Retry the install; the failure is usually transient (lock/AV interference).","Exclude the app's managed-bin directory from antivirus real-time scanning.","Check that the destination directory isn't locked by another running instance of the app.","Inspect swap_dir's implementation if it recurs — the staging dir was verified, so the swap is at fault."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match whisper::install(variant, &progress).await {\n    Err(e) if e.to_string().contains(\"sumiu depois de mover\") => {\n        // transient AV/lock interference: wait and retry the install\n    }\n    other => other?,\n}","preventionTips":["Whitelist the managed-bin directory in antivirus software.","Avoid running two app instances that install to the same directory concurrently.","Install to local (non-network) disks."],"tags":["filesystem","install","invariant","whisper-cpp"],"backgroundTag":"internal-invariant-violation","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}