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: CLAUDE.md entry #99 — isTauri v2 mega-bug + polling fix
PurpleDoubleDc1b6f3197142
diff --git a/CLAUDE.md b/CLAUDE.mdindex 92c37bb8..46a754a2 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -180,6 +180,8 @@ 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 of persistence is still outstanding** — LTO release builds on this machine get stuck at ~25 min on `codegen-units = 1 + lto = true + opt-level = "s"`, got killed 3× mid-link. Code is correct, tests are green, Desktop installer (20:46 build) has commits #1-#4 but NOT #5; requires ONE MORE `npm run tauri:build` to completion. See memory `project_v233_ultimate_e2e_session.md` for the verification plan.+### 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.2. **LTX VAEDecode reference** — dynamic-workflow.ts line 263: vaeSourceId incorrectly points to UNETLoader output for LTX strategy. Fix when LTX model is installed for testing.