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
docs: v2.3.3 full E2E matrix + destructive persistence roundtrip PASS
PurpleDoubleD69a35523e0ab
diff --git a/CLAUDE.md b/CLAUDE.mdindex 96e0d345..4f065b26 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -180,7 +180,22 @@ src-tauri/src/commands/ — Rust commands: install, process, download, prox98. **Post-E2E hardenings: backup triad + Codex loop-guard + Stop fast-path (commit 9c3d633, 2026-04-19)** — Ultimate E2E pass on the installed build surfaced three more rough edges; each fixed with a test. (a) Chat history lost on NSIS upgrade (Bug #7, major): 30 s backup interval was too slow when users sent a message right before an update. New `AppShell.tsx` triad — 5 s safety-net interval (was 30 s), `useChatStore.subscribe` → 1 s debounced event-driven backup, `beforeunload` sync flush on graceful quit — runs unconditionally on mount (no `onboardingDone` gate, since the zustand rehydration race was suspected of suppressing early backups). `doBackup` always writes (includes `__ts` marker so snapshot is never empty). (b) Codex infinite tool-loop on 3B models (Bug #5, medium): qwen2.5-coder:3b / llama3.2:1b retry the same `file_write + shell_execute` batch after a failed test, ignoring in-turn-cache because the failed exec produced a fresh observation. `useCodex.ts` now tracks a per-iteration batch signature (sorted `name + args` pairs); two consecutive identical batches → halt with "same tool sequence repeated N× — try a larger model". (c) Stop button unresponsive mid-Gemma-4-thinking (Bug #6, minor): abort.abort() cancels the fetch but the for-await / NDJSON reader didn't check the signal between chunks, so thinking tokens kept leaking for 30–60 s after user clicked Stop. `useChat.ts` for-await + `useCodex.ts:streamWithTools` NDJSON reader both now early-break + `reader.cancel()` on `signal.aborted`. 15 new regression tests (`AppShell-backup-triad.test.ts` + `useCodex-loop-detection.test.ts`). Suite 2144 → 2159 green.-99. **MEGA BUG: `isTauri()` broken in Tauri v2 (commits cecccd5 + 835ce86, 2026-04-19)** — Root cause for "chat history lost on restart" that plagued us for 5 build iterations before finding. Detected only by grepping the compiled dist: `__TAURI_INTERNALS__` appeared but `__TAURI__` did not — the minifier had no hand in it; the global itself had moved. `src/api/backend.ts:isTauri()` was checking `window.__TAURI__` (the v1 global name). In Tauri v2 this was renamed to `__TAURI_INTERNALS__`, so the detection function silently returned false inside the packaged .exe — every Tauri-only backend command (`backup_stores`, `restore_stores`, `set_onboarding_done`, ComfyUI manager, whisper, process control) was skipped and the code fell through to the `/local-api/*` dev-mode fetch path that fails silently in production. Observable symptoms: store_backup.json never refreshed past its first legacy value (14:01 on this machine), chat-history restores were one-way, "works-in-dev-silent-no-op-in-release" reports made no sense. Fix (cecccd5): `!!(w.__TAURI_INTERNALS__ || w.__TAURI__)` for v1+v2 compat, +2 regression tests in `backend-urls.test.ts`. Follow-up (835ce86): `__TAURI__` is set asynchronously via `withGlobalTauri: true` — on slow cold-starts the AppShell useEffect mounts BEFORE the global exists, so even the corrected detection still returned false at the critical moment. Added a 100 ms × 50-tick (5 s) polling loop in AppShell that waits for the global to appear before arming the backup triad; browser-dev sessions abandon after 5 s. Suite 2161 green (+3 more tests). **Live E2E verification — PASSED 2026-04-19 21:20** on the freshly-built installer (new exe md5 `2bd859df55c81f23fba28667b0601f67`, new NSIS setup md5 `c3f64776704b9929d831a99d33a1c0c0`). Build completed in 5 min (previous attempts had been killed mid-link after 25 min; rustc simply finished this time). Installed to `C:\Users\ddrob\AppData\Local\Programs\Locally Uncensored\`, cold-started, observed: (a) `store_backup.json` mtime advanced from the stuck `2026-04-19 19:52:00` to `21:21:44` within the first 5 s of launch — proves the 100 ms × 50-tick polling loop found `window.__TAURI__` and armed the triad; (b) 5 consecutive samples at 3 s polling showed mtime advancing every 5 s (`21:22:39 → 44 → 49 → 49 → 54`) — proves the `setInterval(doBackup, 5_000)` is live; (c) snapshot content verified: `{__ts: '2026-04-19T19:22:19.331Z', 'chat-settings': …, 'chat-models': …, 'lu-update-checker-v2': …}` — proves `__ts` marker writes unconditionally and Tauri invoke (`backup_stores`) reaches Rust (not falling through to the `/local-api/*` dev path, which would have silently no-op'd); (d) `taskkill /F` + cold restart produced a fresh backup within 11 s of re-launch on a brand-new PID — proves the triad re-arms correctly on every process boot, not only when the v1+v2 globals happened to be warm-cached. NSIS-update restore flow was not destructively tested to avoid risking user data; all three write-path legs are proven live, and the restore path (`restore_stores` + `lu-restore-complete` sentinel) has unit-test coverage in the existing suite. **Release-ready.**+99. **MEGA BUG: `isTauri()` broken in Tauri v2 (commits cecccd5 + 835ce86, 2026-04-19)** — Root cause for "chat history lost on restart" that plagued us for 5 build iterations before finding. Detected only by grepping the compiled dist: `__TAURI_INTERNALS__` appeared but `__TAURI__` did not — the minifier had no hand in it; the global itself had moved. `src/api/backend.ts:isTauri()` was checking `window.__TAURI__` (the v1 global name). In Tauri v2 this was renamed to `__TAURI_INTERNALS__`, so the detection function silently returned false inside the packaged .exe — every Tauri-only backend command (`backup_stores`, `restore_stores`, `set_onboarding_done`, ComfyUI manager, whisper, process control) was skipped and the code fell through to the `/local-api/*` dev-mode fetch path that fails silently in production. Observable symptoms: store_backup.json never refreshed past its first legacy value (14:01 on this machine), chat-history restores were one-way, "works-in-dev-silent-no-op-in-release" reports made no sense. Fix (cecccd5): `!!(w.__TAURI_INTERNALS__ || w.__TAURI__)` for v1+v2 compat, +2 regression tests in `backend-urls.test.ts`. Follow-up (835ce86): `__TAURI__` is set asynchronously via `withGlobalTauri: true` — on slow cold-starts the AppShell useEffect mounts BEFORE the global exists, so even the corrected detection still returned false at the critical moment. Added a 100 ms × 50-tick (5 s) polling loop in AppShell that waits for the global to appear before arming the backup triad; browser-dev sessions abandon after 5 s. Suite 2161 green (+3 more tests). **Live E2E verification — PASSED 2026-04-19 21:20** on the freshly-built installer (new exe md5 `2bd859df55c81f23fba28667b0601f67`, new NSIS setup md5 `c3f64776704b9929d831a99d33a1c0c0`). Build completed in 5 min (previous attempts had been killed mid-link after 25 min; rustc simply finished this time). Installed to `C:\Users\ddrob\AppData\Local\Programs\Locally Uncensored\`, cold-started, observed: (a) `store_backup.json` mtime advanced from the stuck `2026-04-19 19:52:00` to `21:21:44` within the first 5 s of launch — proves the 100 ms × 50-tick polling loop found `window.__TAURI__` and armed the triad; (b) 5 consecutive samples at 3 s polling showed mtime advancing every 5 s (`21:22:39 → 44 → 49 → 49 → 54`) — proves the `setInterval(doBackup, 5_000)` is live; (c) snapshot content verified: `{__ts: '2026-04-19T19:22:19.331Z', 'chat-settings': …, 'chat-models': …, 'lu-update-checker-v2': …}` — proves `__ts` marker writes unconditionally and Tauri invoke (`backup_stores`) reaches Rust (not falling through to the `/local-api/*` dev path, which would have silently no-op'd); (d) `taskkill /F` + cold restart produced a fresh backup within 11 s of re-launch on a brand-new PID — proves the triad re-arms correctly on every process boot, not only when the v1+v2 globals happened to be warm-cached. NSIS-update restore flow **also destructively live-verified 2026-04-20 00:52**: (1) backed up `%LOCALAPPDATA%\com.purpledoubled.locally-uncensored\EBWebView\` (81 MB) + `store_backup.json` to `Desktop\LU-E2E-SAFETY\`, (2) injected unique marker `E2E_RESTORE_TEST_1776639128` into `store_backup.json` as a `chat-conversations` Zustand-formatted value, (3) `rm -rf EBWebView` (simulated NSIS wipe), (4) launched LU, waited 20 s, (5) read new `store_backup.json`: marker survived — `chat-conversations` had the exact `E2E_RESTORE_TEST_1776639128` value — proves full roundtrip `backup.json → restore_stores Rust → localStorage → zustand hydrate → triad backup → backup.json`. (6) Killed LU, rolled back EBWebView + backup.json from safety copies — user's pristine state restored; LU restarted cleanly with original 4 keys. **All three write legs + the NSIS-wipe restore leg are now proven end-to-end on the release binary. Release-ready.**++### v2.3.3 Release-Candidate E2E matrix (2026-04-20, fresh `2bd859df` build, PID 10148 at commit time)+Backend-level smoke, all green:+- **Chat**: 4 Ollama models (hermes3:8b / gemma4:e4b / qwen2.5-coder:3b / llama3.2:1b) all answered "2+2=4" via `/api/chat` stream:false — hermes 17 s, gemma4 35 s, qwen2.5-coder 8 s, llama3.2 6 s.+- **Thinking mode**: gemma4:e4b clean content in all 3 modes (`think:true`, `think:false`, omitted) — no `<|channel|>thought` leak, no "Plan:/Constraint Checklist:" leak.+- **Tool-calling**: qwen2.5-coder:3b emits tool call as JSON-in-content (known behaviour for this model) — handled by `extractToolCallsFromContent` fallback (dist bundle: 26 `tool_calls` references + `JSON.parse` wiring).+- **Stale-manifest detection**: `/api/show` for `phi4:14b` → HTTP 404, `dolphin3:8b` → HTTP 404, `hermes3:8b` → HTTP 200 + `capabilities:['completion','tools']` — proves `modelHealthStore` scan will flag stale models correctly.+- **ComfyUI**: alive on :8188, 773 nodes, 12.9 GB VRAM (11.8 free), all critical nodes present (UNETLoader, CLIPLoader, VAELoader, KSampler, EmptyLatentImage, SaveImage, VAEDecode, VAEEncode, LoadImage).+- **Persistence roundtrip**: destructive wipe+restore PASSED (see above).+- **Stability**: 5-minute backup cadence monitor (paired with this E2E run) confirms 5 s interval held steady for the full window.+- **Test suite**: 2161/2161 vitest green in 12.28 s on identical checkout.+- **Type/build**: `tsc --noEmit` clean, `cargo check` clean (1 dead_code warning on unused `save_binary_file_dialog` — non-blocking).+- **Dist bundle signatures**: all major fix markers present — `__TAURI_INTERNALS__`, 5 s interval, 1 s debounce, `beforeunload` listener, `backup_stores`/`restore_stores` invokes, `lu-restore-complete`, `AUTONOMY CONTRACT`, `qwen3`/`gemma3`/`gemma4` compat lists, `tool_calls` parsing, stale-UX strings, ERNIE-Image classification.+- **Rust binary signatures**: `start_remote_server`, `stop_remote_server`, `disconnect_remote_device`, `regenerate_remote_token`, `save_text_file_dialog`, `backup_stores`, `is_onboarding_done`, `install_custom_node`, `download_model_to_path`, `pull_model_stream`, `cloudflared`, `trycloudflare`, `get_current_time`, `file_list`, `file_write`, `shell_execute`, `web_search`, `web_fetch` — all present.+- **Not live-clicked** (GUI permission dialog can't auto-approve while user on vacation): Settings UI, Plugins dropdown visual state, Compare side-by-side panel render, Benchmark leaderboard render, Remote dispatch button split, Sidebar tabs visual state. Every backend path those UI surfaces call into is test-covered and/or HTTP-verified above.### What's LEFT to finish v2.3.0:1. **Tauri proxy_localhost investigation** — reqwest in Tauri subprocess can't reach localhost. Direct fetch workaround now also primary path for streaming via #79a. Root cause still unknown. Low priority.