The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(#33,#32): AV false-positive metadata + ComfyUI install reliability
PurpleDoubleD10cdb6c68e8e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cdddcda0..b2f0b566 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -60,7 +60,7 @@ All notable changes to Locally Uncensored are documented here.- Tiny grammar fix in the Create empty-state copy: "Install **an image** model" / "Install **a video** model" (was "Install a image model" in both branches).### Added-- **CONTRIBUTING.md — Dev Setup now documents all three local dev workflows** (`npm run tauri:dev` for hot-reload with Rust rebuilds, `npm run dev` for browser-only UI work, `npm run tauri:build` for a full signed installer). Reported in Discord by @k-wilkinson (sourceodin) as a missing-docs ask. Clarifies that Tauri invokes only resolve under `tauri:dev`.+- **CONTRIBUTING.md — Dev Setup now documents all three local dev workflows** (`npm run tauri:dev` for hot-reload with Rust rebuilds, `npm run dev` for browser-only UI work, `npm run tauri:build` for a full NSIS installer). Reported in Discord by @k-wilkinson (sourceodin) as a missing-docs ask. Clarifies that Tauri invokes only resolve under `tauri:dev`.### Changed- Bumped `package.json` 2.3.7 → 2.3.9 (was lagging behind `src-tauri/tauri.conf.json`). Bumped `src-tauri/Cargo.toml` 2.3.7 → 2.3.9 (also lagging). Website + download URLs + schema.org metadata updated to 2.3.9.diff --git a/README.md b/README.mdindex c13bc7ef..49319926 100644--- a/README.md+++ b/README.md@@ -149,6 +149,8 @@ Download the installer from [Releases](https://github.com/PurpleDoubleD/locally-> **Plug & Play:** Just install and launch. The setup wizard auto-detects all 12 supported local backends ([Ollama](https://ollama.com/), [LM Studio](https://lmstudio.ai/), [vLLM](https://github.com/vllm-project/vllm), [KoboldCpp](https://github.com/LostRuins/koboldcpp), llama.cpp, LocalAI, Jan, GPT4All, text-generation-webui, TabbyAPI, Aphrodite, SGLang). Nothing installed yet? The wizard shows one-click install links for every backend.+> **Antivirus warning?** Some engines (ESET, Avast, Microsoft SmartScreen) flag the installer as suspicious — this is a **false positive** caused by heuristics on unsigned NSIS installers that download other binaries. The installer is built by GitHub Actions from public source on `master` (`.github/workflows/release.yml`). The auto-update channel is signed against a public minisign key. Full context, verification steps, and one-click vendor submission links: see [SECURITY.md](SECURITY.md#antivirus--browser-false-positives).+---## Quick Startdiff --git a/SECURITY.md b/SECURITY.mdindex e89659dc..5db4ee2f 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -1,19 +1,13 @@# Security Policy-## Supported Versions--| Version | Supported |-|---------|-----------|-| 1.0.x | ✅ |-## Reporting a VulnerabilityIf you discover a security vulnerability, please report it responsibly.**Do NOT open a public issue.** Instead:-1. Email the details to the maintainer (open a private security advisory via GitHub)-2. Or use [GitHub's private vulnerability reporting](https://github.com/PurpleDoubleD/locally-uncensored/security/advisories/new)+1. Use [GitHub's private vulnerability reporting](https://github.com/PurpleDoubleD/locally-uncensored/security/advisories/new), or+2. Reach out via the [Discord](https://discord.gg/nHnGnDw2c8) DM.Include:- Description of the vulnerability@@ -21,23 +15,71 @@ Include:- Potential impact- Suggested fix (if you have one)-## Response Timeline+### Response Timeline- **Acknowledgment**: Within 48 hours- **Assessment**: Within 1 week- **Fix**: Depends on severity, but we aim for patches within 2 weeks for critical issues-## Scope+### In-Scope-Since Locally Uncensored runs **entirely locally** on your machine, the attack surface is limited. However, we still take the following seriously:+Locally Uncensored runs entirely locally on your machine, so the attack surface is limited. We still take the following seriously:- **XSS in the chat UI** — malicious model outputs that could execute scripts- **Path traversal** — file access outside intended directories- **ComfyUI API abuse** — unintended command execution through the ComfyUI bridge-- **Dependency vulnerabilities** — outdated npm packages with known CVEs+- **Remote Access** — auth bypass, passcode brute-force, unauthorized chat dispatch over LAN or Cloudflare Tunnel+- **Dependency vulnerabilities** — outdated npm or Cargo packages with known CVEs-## Out of Scope+### Out of Scope-- Vulnerabilities in Ollama or ComfyUI themselves (report to their maintainers)+- Vulnerabilities in Ollama, ComfyUI, LM Studio, or other backends themselves (report to their maintainers)- Issues that require physical access to the machine- Social engineering attacks+- Antivirus false positives (see the next section)++---++## Antivirus & Browser False Positives++Some antivirus engines and browser SmartScreen prompts flag the Windows installer as suspicious or as a generic trojan. This is a **false positive** caused by heuristics, not actual malware. Reports we have seen so far:++- **ESET**: blocks the installer at run-time+- **Avast**: `Win32:NSIS_Error[Heur]` heuristic on the NSIS bootstrap+- **Microsoft SmartScreen**: "unrecognized app" warning on first run++### Why it happens++1. **The installer is not yet Authenticode-signed.** We sign the auto-update channel with a Tauri / minisign key (see below), but the NSIS `.exe` you download from GitHub Releases does not yet carry a Microsoft code-signing certificate. Without that certificate, every reputation-based heuristic starts at zero trust.+2. **The app pattern looks suspicious to behavioural scanners.** Locally Uncensored is a Tauri app (small Rust binary + WebView), packaged with NSIS, that on first run downloads and executes other binaries (Ollama, ComfyUI, model files, Python). That combination overlaps with the behavioural fingerprint of certain droppers, even though every download path is open-source and visible in the code (`src-tauri/src/commands/install.rs`, `src-tauri/src/commands/ollama.rs`).+3. **NSIS itself is a frequently-flagged installer format**, since some malware families have used NSIS in the past.++### What you can do as a user++- **Verify the source.** Only download from the [official GitHub Releases page](https://github.com/PurpleDoubleD/locally-uncensored/releases). Every release is built by GitHub Actions from public source on the `master` branch — see `.github/workflows/release.yml`.+- **Verify the SHA-256.** GitHub Releases lists the exact bytes uploaded. The same hash should appear on [VirusTotal](https://www.virustotal.com/) if you scan it yourself. The community has done this before — see [Discussion #25 (jbarkls, 7 scanners + OPSWAT deep scan, all clear)](https://github.com/PurpleDoubleD/locally-uncensored/discussions/25).+- **Verify the auto-update.** Once installed, `Settings → Updates` checks `latest.json` from GitHub Releases and validates the bundle signature against this minisign public key:+ ```+ RWRHseb4LudtbIpBRaMDxMpSLMq+1TqeULJS/HY2/eviNqnAXVVyGsDc+ ```+ If a malicious update were ever served, the signature check would fail and the update would be rejected.+- **Submit the false positive.** Antivirus vendors fix false positives quickly when users submit the file. Direct links:+ - [ESET](https://support.eset.com/en/kb141-submit-a-virus-spyware-or-suspicious-file-to-eset-virus-lab)+ - [Microsoft Defender](https://www.microsoft.com/en-us/wdsi/filesubmission)+ - [Avast / AVG](https://www.avast.com/false-positive-file-form.php)+ - [Bitdefender](https://www.bitdefender.com/consumer/support/answer/29358/)+ - [Kaspersky](https://opentip.kaspersky.com/?tab=fileupload)+ - [Norton / Symantec](https://submit.norton.com/falsepositive)+ - [McAfee](https://www.mcafee.com/threat-intelligence/disputed-detection.aspx)+- **Build it yourself.** AGPL-3.0 means you can clone the repo, run `npm ci && npm run tauri build`, and end up with the same installer your antivirus is flagging — but with your own signature surface. See `CONTRIBUTING.md` for the build steps.++### Code-signing roadmap++A proper Authenticode-signed installer is the long-term fix. Two paths are in flight:++- **SignPath.io OSS plan** — free EV code-signing for verified open-source projects. Application status: pending.+- **Self-funded EV certificate** — ~$300-600/year. On the list once the project justifies the cost.++The auto-update channel is already signed (minisign), so the trust path *after* you have a working install is intact. The first install is the only weak link, and it is the one we are working to close.++If you have experience with cross-signing, EV cert provisioning, or SignPath onboarding — please get in touch via the Discord.diff --git a/docs/blog/locally-uncensored-v2-4-0-release.html b/docs/blog/locally-uncensored-v2-4-0-release.htmlindex 97fec578..3f9123af 100644--- a/docs/blog/locally-uncensored-v2-4-0-release.html+++ b/docs/blog/locally-uncensored-v2-4-0-release.html@@ -219,7 +219,7 @@ Permissions associated with this command: core:window:allow-start-dragging</code<h2>Download</h2>- <p>v2.4.0 is on <a href="https://github.com/PurpleDoubleD/locally-uncensored/releases/tag/v2.4.0">GitHub Releases</a>. Signed installers for Windows (<code>.exe</code>, <code>.msi</code>) and Linux (<code>.deb</code>, <code>.rpm</code>, <code>.AppImage</code>). Auto-update picks the new build up on next launch for anyone on v2.3.x.</p>+ <p>v2.4.0 is on <a href="https://github.com/PurpleDoubleD/locally-uncensored/releases/tag/v2.4.0">GitHub Releases</a>. Installers for Windows (<code>.exe</code>, <code>.msi</code>) and Linux (<code>.deb</code>, <code>.rpm</code>, <code>.AppImage</code>) — the auto-update channel is signed against a public minisign key. Auto-update picks the new build up on next launch for anyone on v2.3.x.</p><h2>Related</h2>diff --git a/docs/index.html b/docs/index.htmlindex 4b4c80e5..64add822 100644--- a/docs/index.html+++ b/docs/index.html@@ -881,6 +881,7 @@ footer a:hover{color:var(--fg)}<a href="https://github.com/PurpleDoubleD/locally-uncensored/releases">All releases</a><a href="https://github.com/PurpleDoubleD/locally-uncensored">Source on GitHub</a><a href="https://github.com/PurpleDoubleD/locally-uncensored/discussions">Discussions</a>+ <a href="https://github.com/PurpleDoubleD/locally-uncensored/blob/master/SECURITY.md#antivirus--browser-false-positives">Antivirus warning?</a></div></div></section>@@ -962,7 +963,7 @@ footer a:hover{color:var(--fg)}<p class="eyebrow">Why</p><h2>Made for people who want <em>their</em> AI on <em>their</em> machine.</h2><p>Most local-AI tools stop at text chat. This one gives you the whole studio: <em>text, code, images, video</em>, and your phone can drive it from anywhere. No data leaves your box unless you tell it to. No subscription. No telemetry.</p>- <p>Open source under <strong>AGPL-3.0</strong>. Auto-detects twelve backends and downloads models in one click. Signed installer, signed auto-update channel, covered by <strong>2,105 unit tests</strong>.</p>+ <p>Open source under <strong>AGPL-3.0</strong>. Auto-detects twelve backends and downloads models in one click. Signed auto-update channel, covered by <strong>2,200+ unit tests</strong>.</p></div></section>@@ -981,12 +982,12 @@ footer a:hover{color:var(--fg)}<div class="container"><p class="eyebrow">Setup</p><h2>Running in under <em>five minutes.</em></h2>- <p class="section-lead">No Docker. No terminal. No config files. Install the signed installer, let the wizard scan your system, start chatting.</p>+ <p class="section-lead">No Docker. No terminal. No config files. Run the installer, let the wizard scan your system, start chatting.</p><div class="steps"><article class="step"><span class="step-num">01 · Install</span><h3>Download & install.</h3>- <p>One signed installer. Windows · Linux. Auto-updates over a signed channel. AGPL-3.0.</p>+ <p>One installer. Windows · Linux. Auto-updates over a signed channel. AGPL-3.0.</p></article><article class="step"><span class="step-num">02 · Detect</span>@@ -1181,6 +1182,7 @@ footer a:hover{color:var(--fg)}<a href="https://github.com/PurpleDoubleD/locally-uncensored/releases">All releases</a><a href="https://github.com/PurpleDoubleD/locally-uncensored">Source on GitHub</a><a href="https://github.com/PurpleDoubleD/locally-uncensored/discussions">Discussions</a>+ <a href="https://github.com/PurpleDoubleD/locally-uncensored/blob/master/SECURITY.md#antivirus--browser-false-positives">Antivirus warning?</a></div></div></section>diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lockindex ab0cb8f5..3433fb98 100644--- a/src-tauri/Cargo.lock+++ b/src-tauri/Cargo.lock@@ -2508,7 +2508,7 @@ dependencies = [[[package]]name = "locally-uncensored"-version = "2.4.0"+version = "2.4.1"dependencies = ["axum","base64 0.22.1",diff --git a/src-tauri/src/commands/install.rs b/src-tauri/src/commands/install.rsindex 348977fa..a86cfc97 100644--- a/src-tauri/src/commands/install.rs+++ b/src-tauri/src/commands/install.rs@@ -1,5 +1,5 @@use std::fs;-use std::io::Read as IoRead;+use std::io::{BufRead, BufReader, Read as IoRead};use std::path::PathBuf;use std::process::{Command, Stdio};use std::sync::{Arc, Mutex};@@ -16,6 +16,202 @@ use crate::state::{AppState, InstallState};#[cfg(target_os = "windows")]const CREATE_NO_WINDOW: u32 = 0x08000000;+// ── pip helpers (issue #32: PyTorch / ComfyUI install reliability) ───────────++/// Push a log line to the shared install state. Best-effort — silently+/// no-ops if the mutex is poisoned (which only happens if a thread panicked+/// while holding the lock; the install is already broken at that point).+fn push_install_log(state: &Arc<Mutex<InstallState>>, msg: &str) {+ if let Ok(mut s) = state.lock() {+ s.logs.push(msg.to_string());+ }+}++/// Detect pip errors that warrant an automatic retry with backoff.+/// Conservative — only retries on errors caused by transient network+/// conditions, not on auth, permission, disk-full, or python-side bugs.+fn is_transient_pip_error(stderr: &str) -> bool {+ let lower = stderr.to_lowercase();+ lower.contains("403 ")+ || lower.contains("502 ")+ || lower.contains("503 ")+ || lower.contains("504 ")+ || lower.contains("429 ")+ || lower.contains("sslerror")+ || lower.contains("ssl: ")+ || lower.contains("readtimeouterror")+ || lower.contains("connecttimeouterror")+ || lower.contains("connectiontimeouterror")+ || lower.contains("connectionerror")+ || lower.contains("connectionreseterror")+ || lower.contains("connection reset")+ || lower.contains("connection aborted")+ || lower.contains("connection refused")+ || lower.contains("incompleteread")+ || lower.contains("temporary failure")+ || lower.contains("network is unreachable")+ || lower.contains("could not fetch")+ || lower.contains("read timed out")+ || lower.contains("eof occurred in violation of protocol")+ || lower.contains("max retries exceeded")+}++/// Turn raw pip stderr into a user-friendly hint with troubleshooting+/// guidance. The first line of the returned string is a short diagnosis;+/// the rest is the truncated original error for context.+fn diagnose_pip_error(stderr: &str) -> String {+ let lower = stderr.to_lowercase();+ let snippet: String = stderr.chars().take(400).collect();++ let hint = if lower.contains("ssl") {+ "SSL error reaching pypi.org. Often caused by an antivirus / firewall \+ intercepting TLS, or a stale system clock. Disable TLS interception \+ for python.exe, fix the system clock, then retry."+ } else if lower.contains("403 ") {+ "HTTP 403 from pypi.org or pytorch.org. The mirror may be blocked on \+ your network. Try a different network or VPN, then retry."+ } else if lower.contains("429 ") {+ "Rate limited (HTTP 429). Wait a few minutes and retry."+ } else if lower.contains("timeout") || lower.contains("timed out") {+ "Network timeout. Slow connection or congested mirror. Retry on a \+ faster network, or run the install during off-peak hours."+ } else if lower.contains("connection") {+ "Connection error. Check internet connectivity, restart the app, \+ and retry."+ } else if lower.contains("no space") || lower.contains("errno 28") {+ "Out of disk space. PyTorch + dependencies need ~5 GB free. Free up \+ space and retry."+ } else if lower.contains("permission") || lower.contains("errno 13") {+ "Permission denied. Make sure no other process is using Python, then \+ retry. On Windows: close any open Python REPLs / Jupyter / IDE \+ debuggers."+ } else if lower.contains("no module named") || lower.contains("modulenotfounderror") {+ "Python install is missing pip or is broken. Reinstall Python 3.10+ \+ from python.org with 'Add to PATH' checked."+ } else if lower.contains("could not find a version") {+ "No matching wheel for your Python version. ComfyUI needs Python \+ 3.10, 3.11, or 3.12. Reinstall a supported Python version."+ } else {+ ""+ };++ if hint.is_empty() {+ snippet+ } else {+ format!("{}\n\n--- pip output ---\n{}", hint, snippet)+ }+}++/// Run a `python -m pip install ...` command, streaming its stdout + stderr+/// line-by-line into the install state's `logs` so the user sees live+/// progress instead of a frozen UI. Retries up to `max_attempts` times on+/// transient network errors with exponential backoff (10s, 30s, 90s).+///+/// On non-transient errors or after exhausting retries, returns Err with a+/// human-readable diagnosis prepended to the truncated original error.+fn pip_install_streaming_with_retry(+ args: &[&str],+ python_bin: &str,+ max_attempts: u32,+ install_state: &Arc<Mutex<InstallState>>,+) -> Result<(), String> {+ let mut delay_seconds = 10u64;+ let mut last_stderr = String::new();++ for attempt in 1..=max_attempts {+ if attempt > 1 {+ push_install_log(+ install_state,+ &format!(+ "Transient network error — retry {}/{} after {}s wait...",+ attempt, max_attempts, delay_seconds+ ),+ );+ std::thread::sleep(std::time::Duration::from_secs(delay_seconds));+ delay_seconds = (delay_seconds * 3).min(180);+ }++ let mut cmd = Command::new(python_bin);+ cmd.args(args)+ .stdout(Stdio::piped())+ .stderr(Stdio::piped());+ #[cfg(target_os = "windows")]+ cmd.creation_flags(CREATE_NO_WINDOW);++ let mut child = match cmd.spawn() {+ Ok(c) => c,+ Err(e) => return Err(format!("Could not start pip ({}). Is Python on PATH?", e)),+ };++ let stdout = child.stdout.take();+ let stderr = child.stderr.take();+ let stderr_capture: Arc<Mutex<String>> = Arc::new(Mutex::new(String::new()));++ // Stream stdout to install logs+ let stdout_state = install_state.clone();+ let stdout_handle = std::thread::spawn(move || {+ if let Some(out) = stdout {+ let reader = BufReader::new(out);+ for line in reader.lines().map_while(Result::ok) {+ let trimmed = line.trim();+ if !trimmed.is_empty() {+ if let Ok(mut s) = stdout_state.lock() {+ s.logs.push(trimmed.to_string());+ }+ }+ }+ }+ });++ // Stream stderr to install logs AND capture for retry decision+ let stderr_state = install_state.clone();+ let stderr_capture_clone = stderr_capture.clone();+ let stderr_handle = std::thread::spawn(move || {+ if let Some(err) = stderr {+ let reader = BufReader::new(err);+ for line in reader.lines().map_while(Result::ok) {+ if let Ok(mut buf) = stderr_capture_clone.lock() {+ buf.push_str(&line);+ buf.push('\n');+ }+ let trimmed = line.trim();+ if !trimmed.is_empty() {+ if let Ok(mut s) = stderr_state.lock() {+ s.logs.push(trimmed.to_string());+ }+ }+ }+ }+ });++ let exit_status = match child.wait() {+ Ok(s) => s,+ Err(e) => return Err(format!("pip wait failed: {}", e)),+ };+ let _ = stdout_handle.join();+ let _ = stderr_handle.join();++ if exit_status.success() {+ return Ok(());+ }++ last_stderr = stderr_capture+ .lock()+ .map(|s| s.clone())+ .unwrap_or_default();++ if !is_transient_pip_error(&last_stderr) {+ return Err(diagnose_pip_error(&last_stderr));+ }+ }++ Err(format!(+ "Exhausted {} retry attempts for transient network errors.\n\n{}",+ max_attempts,+ diagnose_pip_error(&last_stderr)+ ))+}+#[tauri::command]pub fn install_comfyui(install_path: Option<String>,@@ -98,34 +294,40 @@ pub fn install_comfyui(nv.creation_flags(CREATE_NO_WINDOW);let has_nvidia = nv.output().map(|o| o.status.success()).unwrap_or(false);- let gpu_info = if has_nvidia { "NVIDIA GPU detected - installing CUDA PyTorch" } else { "No NVIDIA GPU - installing CPU PyTorch" };+ let gpu_info = if has_nvidia { "NVIDIA GPU detected — installing CUDA PyTorch" } else { "No NVIDIA GPU — installing CPU PyTorch" };println!("[Install] {}", gpu_info);- update("installing", &format!("Step 2/3: {} (this may take several minutes)...", gpu_info));-- let torch_args = if has_nvidia {- vec!["-m", "pip", "install", "torch", "torchvision", "torchaudio",- "--index-url", "https://download.pytorch.org/whl/cu121"]+ update("installing", &format!("Step 2/3: {}", gpu_info));+ update(+ "installing",+ "Downloading PyTorch + Torchvision + Torchaudio (~2 GB total). \+ On a typical home connection this takes 10–15 minutes; on slower \+ links it can be longer. Live pip output below — if you see new \+ lines appearing, the install is making progress, not hung.",+ );++ let torch_args: Vec<&str> = if has_nvidia {+ vec![+ "-m", "pip", "install",+ "--progress-bar", "off",+ "--no-input",+ "torch", "torchvision", "torchaudio",+ "--index-url", "https://download.pytorch.org/whl/cu121",+ ]} else {- vec!["-m", "pip", "install", "torch", "torchvision", "torchaudio"]+ vec![+ "-m", "pip", "install",+ "--progress-bar", "off",+ "--no-input",+ "torch", "torchvision", "torchaudio",+ ]};- let mut pip = Command::new(&python_bin);- pip.args(&torch_args).stdout(Stdio::piped()).stderr(Stdio::piped());- #[cfg(target_os = "windows")]- pip.creation_flags(CREATE_NO_WINDOW);- match pip.output() {- Ok(output) if output.status.success() => {+ match pip_install_streaming_with_retry(&torch_args, &python_bin, 3, &install_status) {+ Ok(()) => {update("installing", "PyTorch installed successfully.");}- Ok(output) => {- let stderr = String::from_utf8_lossy(&output.stderr);- let err = format!("PyTorch installation failed: {}", stderr.chars().take(200).collect::<String>());- println!("[Install] {}", err);- update("error", &err);- return;- }- Err(e) => {- let err = format!("Python not found ({}). Install Python 3.10+ first.", e);+ Err(diagnosis) => {+ let err = format!("PyTorch installation failed.\n\n{}", diagnosis);println!("[Install] {}", err);update("error", &err);return;@@ -134,27 +336,26 @@ pub fn install_comfyui(// Step 3: Install ComfyUI requirementsprintln!("[Install] Installing ComfyUI requirements...");- update("installing", "Step 3/3: Installing ComfyUI dependencies...");+ update("installing", "Step 3/3: Installing ComfyUI dependencies (live pip output below)...");let reqs = target_dir.join("requirements.txt");if reqs.exists() {- let mut pip_req = Command::new(&python_bin);- pip_req.args(["-m", "pip", "install", "-r"]).arg(&reqs)- .stdout(Stdio::piped()).stderr(Stdio::piped());- #[cfg(target_os = "windows")]- pip_req.creation_flags(CREATE_NO_WINDOW);- match pip_req.output() {- Ok(output) if output.status.success() => {+ let reqs_str = reqs.to_string_lossy().to_string();+ let req_args = vec![+ "-m", "pip", "install",+ "--progress-bar", "off",+ "--no-input",+ "-r", reqs_str.as_str(),+ ];+ match pip_install_streaming_with_retry(&req_args, &python_bin, 3, &install_status) {+ Ok(()) => {update("installing", "Dependencies installed successfully.");}- Ok(output) => {- let stderr = String::from_utf8_lossy(&output.stderr);- println!("[Install] Requirements install warning: {}", &stderr[..stderr.len().min(200)]);- // Don't fail — some optional deps may fail but ComfyUI can still work- update("installing", "Some dependencies had warnings (non-critical).");- }- Err(_) => {- update("installing", "Could not install some dependencies (non-critical).");+ Err(diagnosis) => {+ // Don't fail the whole install — some optional deps may fail+ // but ComfyUI can still start and the user can fix them later.+ println!("[Install] Requirements install warning: {}", diagnosis);+ update("installing", "Some optional dependencies had warnings (non-critical, ComfyUI should still start).");}}}@@ -463,3 +664,222 @@ pub fn install_custom_node(}}}++// ── tests (issue #32: PyTorch / ComfyUI install reliability) ────────────────++#[cfg(test)]+mod tests {+ use super::*;++ // ── is_transient_pip_error ────────────────────────────────────────────++ #[test]+ fn transient_detects_403() {+ assert!(is_transient_pip_error(+ "ERROR: HTTP error 403 while getting https://files.pythonhosted.org/packages/.../torch.whl"+ ));+ }++ #[test]+ fn transient_detects_502() {+ assert!(is_transient_pip_error(+ "WARNING: Retrying after connection broken by 'NewConnectionError: 502 Bad Gateway'"+ ));+ }++ #[test]+ fn transient_detects_503() {+ assert!(is_transient_pip_error(+ "HTTP 503 service unavailable from pypi"+ ));+ }++ #[test]+ fn transient_detects_429_rate_limit() {+ assert!(is_transient_pip_error(+ "ERROR: 429 Too Many Requests"+ ));+ }++ #[test]+ fn transient_detects_ssl_error() {+ assert!(is_transient_pip_error(+ "SSLError(SSLZeroReturnError(...)) caused TLS handshake failure"+ ));+ }++ #[test]+ fn transient_detects_read_timeout() {+ assert!(is_transient_pip_error(+ "ReadTimeoutError(HTTPSConnectionPool(host='pypi.org', port=443): Read timed out.)"+ ));+ }++ #[test]+ fn transient_detects_connect_timeout() {+ assert!(is_transient_pip_error(+ "ConnectTimeoutError reaching pypi.org"+ ));+ }++ #[test]+ fn transient_detects_connection_reset() {+ assert!(is_transient_pip_error(+ "ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)"+ ));+ }++ #[test]+ fn transient_detects_connection_aborted() {+ assert!(is_transient_pip_error(+ "ConnectionError: ('Connection aborted.', RemoteDisconnected(...))"+ ));+ }++ #[test]+ fn transient_detects_connection_refused() {+ assert!(is_transient_pip_error(+ "ConnectionRefusedError: [Errno 111] Connection refused"+ ));+ }++ #[test]+ fn transient_detects_incomplete_read() {+ assert!(is_transient_pip_error(+ "IncompleteRead(0 bytes read, 1024 more expected)"+ ));+ }++ #[test]+ fn transient_detects_max_retries() {+ assert!(is_transient_pip_error(+ "Max retries exceeded with url: /packages/torch.whl"+ ));+ }++ #[test]+ fn transient_rejects_permission_error() {+ assert!(!is_transient_pip_error(+ "PermissionError: [Errno 13] Permission denied: 'C:\\\\Python\\\\Lib\\\\site-packages\\\\torch'"+ ));+ }++ #[test]+ fn transient_rejects_no_module_error() {+ assert!(!is_transient_pip_error(+ "ModuleNotFoundError: No module named 'pip'"+ ));+ }++ #[test]+ fn transient_rejects_disk_full() {+ assert!(!is_transient_pip_error(+ "OSError: [Errno 28] No space left on device"+ ));+ }++ #[test]+ fn transient_rejects_no_matching_distribution() {+ assert!(!is_transient_pip_error(+ "ERROR: Could not find a version that satisfies the requirement torch (from versions: none)"+ ));+ }++ #[test]+ fn transient_rejects_404_missing_package() {+ // 404 means the file genuinely doesn't exist — retry won't help.+ assert!(!is_transient_pip_error(+ "ERROR: HTTP error 404 while getting nonexistent-package.whl"+ ));+ }++ // ── diagnose_pip_error ────────────────────────────────────────────────++ #[test]+ fn diagnose_ssl_includes_antivirus_hint() {+ let msg = diagnose_pip_error("SSLError(SSLZeroReturnError(...))");+ let lower = msg.to_lowercase();+ assert!(lower.contains("antivirus") || lower.contains("firewall") || lower.contains("clock"));+ }++ #[test]+ fn diagnose_403_suggests_vpn() {+ let msg = diagnose_pip_error("HTTP 403 from pytorch.org");+ let lower = msg.to_lowercase();+ assert!(lower.contains("vpn") || lower.contains("network") || lower.contains("blocked"));+ }++ #[test]+ fn diagnose_429_mentions_rate_limit() {+ let msg = diagnose_pip_error("HTTP 429 Too Many Requests");+ assert!(msg.to_lowercase().contains("rate limit"));+ }++ #[test]+ fn diagnose_disk_full_mentions_space() {+ let msg = diagnose_pip_error("OSError: [Errno 28] No space left on device");+ assert!(msg.to_lowercase().contains("disk") || msg.to_lowercase().contains("space"));+ }++ #[test]+ fn diagnose_permission_suggests_close_python() {+ let msg = diagnose_pip_error("PermissionError: [Errno 13] Permission denied");+ let lower = msg.to_lowercase();+ assert!(lower.contains("permission") && (lower.contains("python") || lower.contains("close") || lower.contains("ide")));+ }++ #[test]+ fn diagnose_no_module_suggests_python_reinstall() {+ let msg = diagnose_pip_error("ModuleNotFoundError: No module named 'pip'");+ let lower = msg.to_lowercase();+ assert!(lower.contains("python") && (lower.contains("reinstall") || lower.contains("3.10")));+ }++ #[test]+ fn diagnose_no_matching_version_suggests_python_version() {+ let msg = diagnose_pip_error("ERROR: Could not find a version that satisfies the requirement torch");+ let lower = msg.to_lowercase();+ assert!(lower.contains("python") || lower.contains("version") || lower.contains("3.10"));+ }++ #[test]+ fn diagnose_unknown_error_falls_through_to_snippet() {+ let raw = "some_completely_random_error_we_haven_t_categorized";+ let msg = diagnose_pip_error(raw);+ assert!(msg.contains(raw));+ }++ #[test]+ fn diagnose_truncates_giant_stderr_to_400_chars_snippet_block() {+ let huge: String = "x".repeat(2000);+ let raw = format!("SSLError: {}", huge);+ let msg = diagnose_pip_error(&raw);+ // Snippet portion is bounded to 400 chars; full message includes hint + label+ // so it should be much shorter than the raw 2000-char input.+ assert!(msg.len() < 1200, "diagnose output was {} chars", msg.len());+ }++ // ── push_install_log ──────────────────────────────────────────────────++ #[test]+ fn push_install_log_appends_to_logs() {+ let state = Arc::new(Mutex::new(InstallState::default()));+ push_install_log(&state, "first");+ push_install_log(&state, "second");+ let s = state.lock().unwrap();+ assert_eq!(s.logs, vec!["first", "second"]);+ }++ #[test]+ fn push_install_log_does_not_clobber_status() {+ let state = Arc::new(Mutex::new(InstallState::default()));+ {+ let mut s = state.lock().unwrap();+ s.status = "installing".to_string();+ }+ push_install_log(&state, "log line");+ let s = state.lock().unwrap();+ assert_eq!(s.status, "installing");+ assert_eq!(s.logs, vec!["log line"]);+ }+}diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex cb3471b5..ce1c09d3 100644--- a/src-tauri/tauri.conf.json+++ b/src-tauri/tauri.conf.json@@ -39,6 +39,13 @@"createUpdaterArtifacts": "v1Compatible","active": true,"targets": "all",+ "publisher": "PurpleDoubleD",+ "copyright": "Copyright (c) 2026 PurpleDoubleD. Licensed under AGPL-3.0.",+ "category": "DeveloperTool",+ "shortDescription": "Private, local AI chat, image, and video generation",+ "longDescription": "Locally Uncensored is an open-source desktop app that runs AI chat, image generation, and video generation entirely on your own machine. Auto-detects 12 local backends (Ollama, LM Studio, vLLM, KoboldCpp, llama.cpp, LocalAI, Jan, TabbyAPI, GPT4All, Aphrodite, SGLang, TGI). Includes a coding agent (Codex), an agent mode with 14 tools and MCP support, A/B model comparison, local benchmarking, document chat with RAG, voice chat, and remote access from your phone over LAN or Cloudflare Tunnel. No telemetry, no analytics, no data leaves your device.",+ "homepage": "https://locallyuncensored.com",+ "license": "AGPL-3.0","resources": ["resources/whisper_server.py", "../dist"],"icon": ["icons/32x32.png",