{"record":{"id":"3b57120d58519f7f","repo":"tonhowtf/omniget","slug":"o-onnx-runtime-ainda-n-o-est-instalado-instale-pela-tela-de","errorCode":null,"errorMessage":"o ONNX Runtime {} ainda não está instalado. Instale pela tela de Modelos (o download vai para {}) ou aponte um {} que você já tenha.","messagePattern":"o ONNX Runtime (.+?) ainda não está instalado\\. Instale pela tela de Modelos \\(o download vai para (.+?)\\) ou aponte um (.+?) que você já tenha\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/onnxrt.rs","lineNumber":256,"sourceCode":"    RuntimeStatus {\n        installed: found.is_some(),\n        path: found.as_ref().map(|(p, _)| p.to_string_lossy().to_string()),\n        source: found.as_ref().map(|(_, s)| (*s).to_string()),\n        version: read_version_marker(),\n        target_version: RUNTIME_VERSION.to_string(),\n        lib_filename: lib_filename().to_string(),\n        can_download: auto_variant_id().is_some(),\n        variants: list_variants(),\n    }\n}\n\n/// Mensagem de erro que diz o que fazer, em vez de só reclamar.\nfn missing_runtime_error() -> anyhow::Error {\n    let where_to = target_dir()\n        .map(|d| d.display().to_string())\n        .unwrap_or_else(|| \"<pasta de dados do app>\".into());\n    if auto_variant_id().is_some() {\n        anyhow!(\n            \"o ONNX Runtime {} ainda não está instalado. Instale pela tela de Modelos \\\n             (o download vai para {}) ou aponte um {} que você já tenha.\",\n            RUNTIME_VERSION,\n            where_to,\n            lib_filename()\n        )\n    } else {\n        anyhow!(\n            \"não existe build oficial do ONNX Runtime para este sistema. \\\n             Aponte um {} que você já tenha (o pacote `onnxruntime` do pip traz um) — \\\n             ele é copiado para {}.\",\n            lib_filename(),\n            where_to\n        )\n    }\n}\n\n/// Caminho que o `ort` já está usando, quando o carregamento deu certo uma vez.","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/onnxrt.rs#L238-L274","documentation":"Raised by missing_runtime_error() when the ONNX Runtime shared library cannot be resolved but an official prebuilt build exists for this platform (auto_variant_id() is Some). The library throws it because ort::init needs a native runtime that is not yet installed; the message tells the user to install via the Models screen or point to an existing library.","triggerScenarios":"Calling init() (directly or via ensure_runtime/api) when resolve_path() returns None: READY is unset, no runtime was downloaded, no configured path points to a valid libonnxruntime, and no system runtime was found.","commonSituations":"Fresh install before downloading the runtime from the Models screen; runtime dir wiped or data dir moved; ONNX_RUNTIME lib path env/config pointing nowhere; upgrading the app which bumps RUNTIME_VERSION.","solutions":["Open the Models screen and install the ONNX Runtime for the current RUNTIME_VERSION","Point the app to an existing onnxruntime shared library you already have (e.g. from the pip package)","Re-run ensure_runtime() to trigger the download flow","Verify the data directory exists and is writable so the install can land there"],"exampleFix":"// before\nlet path = onnxrt::init()?; // panics with missing runtime message on fresh install\n// after\nmatch onnxrt::ensure_runtime(&progress).await {\n    Ok(_) => { let path = onnxrt::init()?; }\n    Err(e) => eprintln!(\"install the runtime from the Models screen: {e}\"),\n}","handlingStrategy":"try-catch","validationCode":"if onnxrt::resolve_path_hint().is_none() { prompt_runtime_install(); }","typeGuard":"fn runtime_available() -> bool { std::fs::metadata(configured_runtime_path()).map(|m| m.is_file()).unwrap_or(false) }","tryCatchPattern":"match onnxrt::init() { Ok(p) => p, Err(e) => { open_models_screen_with_error(e); return; } }","preventionTips":["Call ensure_runtime() on first launch before any ONNX inference","Surface the Models screen install flow when init fails","Log the resolved runtime path and version marker at startup"],"tags":["onnx","rust","missing-dependency","setup"],"backgroundTag":"missing-dependency","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"}