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
Discord bug sweep — Updates / Agent / CivitAI / Import / refresh
PurpleDoubleD8c334ca377c3
diff --git a/docs/blog/best-local-ai-apps-2026.html b/docs/blog/best-local-ai-apps-2026.htmlindex 005a1203..64f14ed9 100644--- a/docs/blog/best-local-ai-apps-2026.html+++ b/docs/blog/best-local-ai-apps-2026.html@@ -128,8 +128,8 @@ ul{margin:12px 0 16px 24px;color:#ccc}li{margin-bottom:8px;font-size:15px}<div class="app-card"><h3>7. SillyTavern — Best for Character AI</h3>-<span class="tag">LLM Chat</span><span class="tag">Characters</span><span class="tag">Extensions</span><span class="tag">AGPL v3</span>-<p style="margin-top:12px">SillyTavern is the king of character-based AI chat. It supports character cards, lorebooks, world-building tools, and a massive extension ecosystem. Works as a frontend for multiple backends including Ollama, Kobold.cpp, and cloud APIs.</p>+<span class="tag">LLM Chat</span><span class="tag">Characters</span><span class="tag">Image Gen</span><span class="tag">Extensions</span><span class="tag">AGPL v3</span>+<p style="margin-top:12px">SillyTavern is the king of character-based AI chat. It supports character cards, lorebooks, world-building tools, and a massive extension ecosystem. Works as a frontend for multiple backends including Ollama, Kobold.cpp, and cloud APIs. Image generation is available via the Stable Diffusion / ComfyUI extension — similar to how Locally Uncensored treats it as a built-in flow.</p><p><strong>Best for:</strong> Character AI enthusiasts who want deep customization and roleplay features.</p><p><a href="locally-uncensored-vs-sillytavern.html">Full comparison: Locally Uncensored vs SillyTavern</a></p></div>diff --git a/docs/blog/locally-uncensored-vs-sillytavern.html b/docs/blog/locally-uncensored-vs-sillytavern.htmlindex 8123e583..ebc4ee17 100644--- a/docs/blog/locally-uncensored-vs-sillytavern.html+++ b/docs/blog/locally-uncensored-vs-sillytavern.html@@ -60,7 +60,7 @@ ul{margin:12px 0 16px 24px;color:#ccc}li{margin-bottom:8px;font-size:15px}<tbody><tr><td>AI Chat</td><td class="check hl">Yes</td><td>Yes</td></tr><tr><td>Character Cards</td><td class="check hl">25 built-in personas</td><td>Thousands (community)</td></tr>-<tr><td>Image Generation</td><td class="check hl"><span class="check">Yes (ComfyUI)</span></td><td><span class="cross">No (display only)</span></td></tr>+<tr><td>Image Generation</td><td class="check hl"><span class="check">Yes (ComfyUI built-in)</span></td><td><span class="check">Yes (via SD / ComfyUI extension)</span></td></tr><tr><td>Video Generation</td><td class="check hl"><span class="check">Yes (Wan 2.1)</span></td><td><span class="cross">No</span></td></tr><tr><td>Coding Agent</td><td class="check hl"><span class="check">Yes (Codex)</span></td><td><span class="cross">No</span></td></tr><tr><td>MCP Tools</td><td class="check hl"><span class="check">13 built-in</span></td><td><span class="cross">No</span></td></tr>@@ -81,7 +81,7 @@ ul{margin:12px 0 16px 24px;color:#ccc}li{margin-bottom:8px;font-size:15px}<h2>Where Locally Uncensored Wins</h2><ul>-<li><strong>Image + Video Generation</strong> — Generate images with Stable Diffusion/FLUX and video with Wan 2.1 directly in the app. SillyTavern can display AI-generated images but doesn't generate them.</li>+<li><strong>Image + Video Generation built-in</strong> — Stable Diffusion/FLUX images and Wan 2.1 video work out of the box. SillyTavern supports image generation through its Stable Diffusion / ComfyUI extension once configured, but video generation isn't part of its scope.</li><li><strong>Simpler setup</strong> — One command vs SillyTavern's multi-step Node.js setup with API configuration.</li><li><strong>Modern UI</strong> — Clean glassmorphism design with dark/light mode. SillyTavern's interface is functional but dated.</li><li><strong>AGPL-3.0 license</strong> — Same open source commitment as SillyTavern. Fork it, modify it, contribute back.</li>diff --git a/src/api/__tests__/model-compatibility.test.ts b/src/api/__tests__/model-compatibility.test.tsindex 9949efd5..67987f7d 100644--- a/src/api/__tests__/model-compatibility.test.ts+++ b/src/api/__tests__/model-compatibility.test.ts@@ -62,12 +62,20 @@ describe('isAgentCompatible', () => {expect(isAgentCompatible('nemotron:8b')).toBe(true)})- it('abliterated models are NOT compatible (need hermes fallback)', () => {- expect(isAgentCompatible('mannix/llama3.1-8b-abliterated:q5_K_M')).toBe(false)- expect(isAgentCompatible('huihui_ai/qwen2.5-abliterated:7b')).toBe(false)+ it('abliterated variants of agent-capable bases ARE compatible', () => {+ // Discord-reported by diimmortalis (2026-04-25): the previous heuristic+ // only allow-listed a tiny set of abliterated bases (qwen3-coder, hermes)+ // and silently disabled the Agent toggle for everyone else, including+ // popular uncensored Qwen 3.5 / Llama 3.1 / Qwen 2.5 builds. We now+ // strip the abliterated/uncensored suffix and check the same+ // AGENT_COMPATIBLE list as the vanilla path.+ expect(isAgentCompatible('mannix/llama3.1-8b-abliterated:q5_K_M')).toBe(true)+ expect(isAgentCompatible('huihui_ai/qwen2.5-abliterated:7b')).toBe(true)+ expect(isAgentCompatible('LEONW24/Qwen3.5-9B-Uncensored:Q4_K_M')).toBe(true)})- it('uncensored models are NOT compatible', () => {+ it('uncensored variants of unknown bases are still NOT compatible', () => {+ // dolphin3 is not in AGENT_COMPATIBLE — strip suffix and check, still no.expect(isAgentCompatible('dolphin3-uncensored:8b')).toBe(false)})@@ -114,8 +122,10 @@ describe('getToolCallingStrategy', () => {expect(getToolCallingStrategy('gemma4:e4b')).toBe('native')})- it('Ollama abliterated models use hermes_xml', () => {- expect(getToolCallingStrategy('mannix/llama3.1-8b-abliterated:q5_K_M')).toBe('hermes_xml')+ it('Ollama abliterated variants of agent-capable bases use native', () => {+ // Same intent as the matching isAgentCompatible test — uncensored llama3.1+ // keeps native tool-calling, the strategy follows.+ expect(getToolCallingStrategy('mannix/llama3.1-8b-abliterated:q5_K_M')).toBe('native')})it('Ollama unknown models use hermes_xml', () => {diff --git a/src/api/comfyui.ts b/src/api/comfyui.tsindex a6cad3ee..a3c70f75 100644--- a/src/api/comfyui.ts+++ b/src/api/comfyui.ts@@ -248,14 +248,32 @@ export async function checkComfyConnection(): Promise<boolean> {}}-/** Force ComfyUI to re-scan model directories. Works on ComfyUI 2024+ with /api/refresh. */-export async function refreshComfyModels(): Promise<boolean> {- try {- const res = await localFetch(comfyuiUrl('/api/refresh'), { method: 'POST' })- return res.ok- } catch {- return false // Older ComfyUI versions without /api/refresh — non-fatal+/**+ * Force ComfyUI to re-scan model directories. Works on ComfyUI 2024+ with+ * /api/refresh.+ *+ * Retries on transient failures because in production we hit two real-world+ * race conditions:+ * 1. ComfyUI is mid-startup and `/api/refresh` 404s briefly (Discord report+ * from Draekzy: logs show repeated localhost:8188 connect errors after a+ * fresh download lands).+ * 2. ComfyUI is busy executing a workflow and accepts the refresh but doesn't+ * finish the directory scan before we query `/object_info`.+ *+ * For both cases a single attempt silently returned `false` and the caller+ * never knew the cache stayed stale.+ */+export async function refreshComfyModels(maxAttempts = 3): Promise<boolean> {+ for (let attempt = 0; attempt < maxAttempts; attempt++) {+ try {+ const res = await localFetch(comfyuiUrl('/api/refresh'), { method: 'POST' })+ if (res.ok) return true+ } catch { /* network blip — retry */ }+ if (attempt < maxAttempts - 1) {+ await new Promise(r => setTimeout(r, 1000 * (attempt + 1)))+ }}+ return false // Older ComfyUI versions without /api/refresh — non-fatal}// ─── System VRAM Detection ───diff --git a/src/api/discover.ts b/src/api/discover.tsindex 1066c752..6e0e6c5f 100644--- a/src/api/discover.ts+++ b/src/api/discover.ts@@ -1482,7 +1482,8 @@ export interface CivitAIModelResult {export async function searchCivitaiModels(query: string,- type: 'Checkpoint' | 'LORA' | 'VAE' | 'TextualInversion' = 'Checkpoint'+ type: 'Checkpoint' | 'LORA' | 'VAE' | 'TextualInversion' = 'Checkpoint',+ apiKey?: string): Promise<CivitAIModelResult[]> {try {const params = new URLSearchParams({@@ -1490,8 +1491,16 @@ export async function searchCivitaiModels(types: type,limit: '20',sort: 'Most Downloaded',+ // LU positions itself as "uncensored" — surface adult content too. Without+ // an explicit nsfw flag CivitAI silently filters most of the SFW catalog+ // for an unauthenticated client, which is what made earlier searches come+ // back near-empty for users who expected to find e.g. uncensored SDXL forks.+ nsfw: 'true',})- const text = await fetchExternal(`https://civitai.com/api/v1/models?${params}`)+ // Adding the user's API key as a bearer token unlocks the full catalog and+ // lifts the per-IP rate limit. Falls back to anon access if no key is set.+ const url = `https://civitai.com/api/v1/models?${params}${apiKey ? `&token=${encodeURIComponent(apiKey)}` : ''}`+ const text = await fetchExternal(url)const data = JSON.parse(text)const items: any[] = data.items ?? []diff --git a/src/components/create/WorkflowSearchModal.tsx b/src/components/create/WorkflowSearchModal.tsxindex 47d4053e..bcf33aaa 100644--- a/src/components/create/WorkflowSearchModal.tsx+++ b/src/components/create/WorkflowSearchModal.tsx@@ -40,6 +40,12 @@ export function WorkflowSearchModal({ open, onClose, modelName, modelType }: Proconst [importJson, setImportJson] = useState('')const [importName, setImportName] = useState('')const [importLoading, setImportLoading] = useState(false)+ // Visible success confirmation after a manual Import action. Without this the+ // Import button silently clears its inputs on success and the user sees no+ // feedback at all (diimmortalis' report: "doesn't seem to persist manually+ // entered json … no feedback or console output when clicking the Import+ // button"). The toast auto-clears after a few seconds.+ const [importSuccess, setImportSuccess] = useState<string | null>(null)const initialSearchDone = useRef(false)const templatesCached = useRef<WorkflowSearchResult[] | null>(null)@@ -172,6 +178,7 @@ export function WorkflowSearchModal({ open, onClose, modelName, modelType }: Proif (!importUrl.trim()) returnsetImportLoading(true)setError(null)+ setImportSuccess(null)try {const workflow = await fetchWorkflowFromUrl(importUrl.trim())const name = importName.trim() || new URL(importUrl).pathname.split('/').pop()?.replace('.json', '') || 'Imported Workflow'@@ -185,6 +192,8 @@ export function WorkflowSearchModal({ open, onClose, modelName, modelType }: ProassignToModelName(modelName, template.id)setImportUrl('')setImportName('')+ setImportSuccess(`Imported "${name}" and assigned to ${modelName}.`)+ setTimeout(() => setImportSuccess(null), 4000)} catch (err) {setError(`Import failed: ${err instanceof Error ? err.message : String(err)}`)} finally {@@ -195,6 +204,7 @@ export function WorkflowSearchModal({ open, onClose, modelName, modelType }: Proconst handleImportJson = () => {if (!importJson.trim()) returnsetError(null)+ setImportSuccess(null)try {const json = JSON.parse(importJson.trim())if (!validateWorkflowJson(json)) {@@ -212,6 +222,8 @@ export function WorkflowSearchModal({ open, onClose, modelName, modelType }: ProassignToModelName(modelName, template.id)setImportJson('')setImportName('')+ setImportSuccess(`Imported "${name}" and assigned to ${modelName}.`)+ setTimeout(() => setImportSuccess(null), 4000)} catch (err) {if (err instanceof SyntaxError) {setError('Invalid JSON. Please paste valid JSON.')@@ -335,6 +347,14 @@ export function WorkflowSearchModal({ open, onClose, modelName, modelType }: Pro</div>)}+ {/* Success — visible confirmation that the manual Import landed */}+ {importSuccess && (+ <div className="flex items-start gap-2 p-2 rounded-lg bg-emerald-500/10 border border-emerald-500/25 text-emerald-300 text-xs">+ <span aria-hidden className="mt-0.5">✓</span>+ <span>{importSuccess}</span>+ </div>+ )}+{/* Content */}{activeTab === 'import' ? (<div className="space-y-3 overflow-y-auto flex-1">diff --git a/src/components/models/DiscoverModels.tsx b/src/components/models/DiscoverModels.tsxindex 76d57c42..b6c8a33a 100644--- a/src/components/models/DiscoverModels.tsx+++ b/src/components/models/DiscoverModels.tsx@@ -17,6 +17,7 @@ import { useModels } from '../../hooks/useModels'import { useDownloadStore } from '../../stores/downloadStore'import { useProviderStore } from '../../stores/providerStore'import { useSettingsStore } from '../../stores/settingsStore'+import { useWorkflowStore } from '../../stores/workflowStore'import { GlassCard } from '../ui/GlassCard'import { GlowButton } from '../ui/GlowButton'import { ProgressBar } from '../ui/ProgressBar'@@ -134,6 +135,12 @@ export function DiscoverModels({ category }: Props) {const [civitaiResults, setCivitaiResults] = useState<CivitAIModelResult[]>([])const [civitaiSearching, setCivitaiSearching] = useState(false)const [civitaiQuery, setCivitaiQuery] = useState('')+ // Track whether the *latest* CivitAI search has been issued at least once,+ // so an empty-state hint can render between "before-first-search" and+ // "search returned 0 hits". Without this we fall through to the silent gap+ // diimmortalis described — empty list, no console output, looks like the+ // button did nothing.+ const [civitaiSearched, setCivitaiSearched] = useState(false)const [loading, setLoading] = useState(false)const [search, setSearch] = useState('')const [systemVRAM, setSystemVRAM] = useState<number | null>(null)@@ -293,7 +300,12 @@ export function DiscoverModels({ category }: Props) {const handleCivitaiSearch = async () => {if (!civitaiQuery.trim()) returnsetCivitaiSearching(true)- const results = await searchCivitaiModels(civitaiQuery, 'Checkpoint')+ setCivitaiSearched(true)+ // Reuse the CivitAI API key the user already configured for the Workflow+ // finder. The model search and the workflow finder share the same backend+ // credential, so plumbing a separate input here would just confuse users.+ const apiKey = useWorkflowStore.getState().civitaiApiKey || undefined+ const results = await searchCivitaiModels(civitaiQuery, 'Checkpoint', apiKey)setCivitaiResults(results)setCivitaiSearching(false)}@@ -679,6 +691,12 @@ export function DiscoverModels({ category }: Props) {)}{civitaiSearching && <div className="text-center py-4 text-gray-500 text-sm">Searching CivitAI...</div>}+ {!civitaiSearching && civitaiSearched && civitaiResults.length === 0 && (+ <div className="text-center py-4 text-[11px] text-gray-500 leading-relaxed">+ No matches for "{civitaiQuery}". Try a broader query, or add your CivitAI API key+ in the Workflow finder for the full catalog.+ </div>+ )}</GlassCard>)}diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsxindex ca7239bc..a847f173 100644--- a/src/components/settings/SettingsPage.tsx+++ b/src/components/settings/SettingsPage.tsx@@ -17,7 +17,7 @@ import { PermissionSettings } from './PermissionSettings'import { MCPServerSettings } from './MCPServerSettings'import { WorkflowList } from '../agents/WorkflowList'import { WorkflowBuilder } from '../agents/WorkflowBuilder'-import { useUpdateStore } from '../../stores/updateStore'+import { useUpdateStore, isNewerVersion } from '../../stores/updateStore'import { useClaudeCodeStore, CLAUDE_CODE_RECOMMENDED_MODELS } from '../../stores/claudeCodeStore'import { backendCall } from '../../api/backend'import { ArrowUpCircle } from 'lucide-react'@@ -705,7 +705,14 @@ export function SettingsPage() {function UpdateSection() {const { currentVersion, latestVersion, updateAvailable, releaseNotes, dismissed, isChecking, checkForUpdate, clearDismiss, openReleasePage } = useUpdateStore()- const showUpdate = updateAvailable && latestVersion+ // Defensive: only treat the persisted `latestVersion` as actually newer if a+ // semver compare confirms it. Otherwise the binary was updated out-of-band+ // and the persisted value is stale (e.g. localStorage still says 2.3.8 while+ // the binary is now 2.4.1). In that case both `updateAvailable` and the+ // "Latest Version" row should hide so we don't display a confusing inversion.+ const latestIsActuallyNewer = !!(latestVersion && isNewerVersion(latestVersion, currentVersion))+ const displayLatestVersion = latestIsActuallyNewer ? latestVersion : null+ const showUpdate = updateAvailable && latestIsActuallyNewerreturn (<Section title="Updates">@@ -716,12 +723,12 @@ function UpdateSection() {<span className="text-[0.65rem] text-gray-300 font-mono">v{currentVersion}</span></div>- {/* Latest version */}- {latestVersion && (+ {/* Latest version — only show if it's actually newer than current */}+ {displayLatestVersion && (<div className="flex items-center justify-between"><span className="text-[0.65rem] text-gray-500">Latest Version</span>- <span className={`text-[0.65rem] font-mono ${updateAvailable ? 'text-emerald-400' : 'text-gray-300'}`}>- v{latestVersion}+ <span className={`text-[0.65rem] font-mono ${showUpdate ? 'text-emerald-400' : 'text-gray-300'}`}>+ v{displayLatestVersion}</span></div>)}@@ -743,7 +750,7 @@ function UpdateSection() {>Download Update</button>- {dismissed === latestVersion && (+ {dismissed === displayLatestVersion && (<buttononClick={clearDismiss}className="px-3 py-1.5 rounded-md text-[0.6rem] text-gray-500 hover:text-gray-300 hover:bg-white/[0.04] transition-colors"diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.tsindex bfdc132a..19481c4b 100644--- a/src/hooks/useCreate.ts+++ b/src/hooks/useCreate.ts@@ -191,14 +191,30 @@ export function useCreate() {}}, [runPreflight])- // Auto-refresh models when a ComfyUI model download completes+ // Auto-refresh models when a ComfyUI model download completes.+ // Schedules three fetches because real-world ComfyUI scans take longer than+ // the /api/refresh round-trip implies: the API responds OK but the in-memory+ // model list catches up only after the directory walk finishes. A single+ // fetch immediately after the event was leaving Draekzy + cprovencher+ // staring at a "model installed but not in dropdown" state for minutes.useEffect(() => {+ let cancelled = false+ const timeouts: ReturnType<typeof setTimeout>[] = []const handler = () => {console.log('[useCreate] Model download completed, refreshing model list...')fetchModels()+ // Belt-and-braces: re-fetch at +2s and +6s in case ComfyUI's scan is slow.+ // fetchModels() is idempotent and cheap (object_info hits cache server-side),+ // so a couple of extra calls cost almost nothing.+ timeouts.push(setTimeout(() => { if (!cancelled) fetchModels() }, 2000))+ timeouts.push(setTimeout(() => { if (!cancelled) fetchModels() }, 6000))}window.addEventListener('comfyui-model-downloaded', handler)- return () => window.removeEventListener('comfyui-model-downloaded', handler)+ return () => {+ cancelled = true+ timeouts.forEach(clearTimeout)+ window.removeEventListener('comfyui-model-downloaded', handler)+ }}, [fetchModels])// Auto-retry model loading when ComfyUI reconnects OR when 0 models found (startup race)diff --git a/src/lib/model-compatibility.ts b/src/lib/model-compatibility.tsindex 300f4732..dbb11ebf 100644--- a/src/lib/model-compatibility.ts+++ b/src/lib/model-compatibility.ts@@ -26,6 +26,17 @@ const AGENT_COMPATIBLE = [/*** Check if a model supports Agent Mode.* Cloud providers always support tools. Ollama needs explicit check.+ *+ * Strategy: strip user-prefix, abliterated/uncensored/instruct/chat suffixes+ * and the :tag, then match the remaining base name against AGENT_COMPATIBLE.+ *+ * Earlier versions kept a much shorter `ABLITERATED_NATIVE` allow-list which+ * over-rejected uncensored variants of agent-capable bases (Qwen 3.5 Uncensored,+ * Llama 3.2 Abliterated, Gemma 4 Uncensored, etc.). For modern agent-capable+ * families the abliteration / uncensoring procedure does not break native+ * tool-calling weights, so falling back to the same compatibility list as the+ * vanilla path matches user expectation. If a specific abliterated build is+ * proven to break tools at runtime, the user can simply toggle Agent Mode off.*/export function isAgentCompatible(modelName: string | null): boolean {if (!modelName) return false@@ -34,17 +45,15 @@ export function isAgentCompatible(modelName: string | null): boolean {// Cloud providers always support tool callingif (providerId === 'openai' || providerId === 'anthropic') return true- // Ollama: check compatibility list+ // Ollama: strip everything decorative and check against the canonical listconst name = modelName.toLowerCase()-- // Some abliterated models retain native tool calling- const ABLITERATED_NATIVE = ['qwen3-coder', 'hermes3', 'hermes-3', 'hermes']- if (name.includes('abliterated') || name.includes('uncensored')) {- const baseName = name.replace(/^[^/]+\//, '').replace(/-abliterated/g, '').replace(/-uncensored/g, '').replace(/:.*$/, '')- return ABLITERATED_NATIVE.some((f) => baseName.startsWith(f))- }-- const baseName = name.replace(/^[^/]+\//, '').replace(/-instruct/g, '').replace(/-chat/g, '').replace(/:.*$/, '')+ const baseName = name+ .replace(/^[^/]+\//, '')+ .replace(/-abliterated/g, '')+ .replace(/-uncensored/g, '')+ .replace(/-instruct/g, '')+ .replace(/-chat/g, '')+ .replace(/:.*$/, '')return AGENT_COMPATIBLE.some((f) => baseName.startsWith(f))}diff --git a/src/stores/__tests__/updateStore.test.ts b/src/stores/__tests__/updateStore.test.tsindex 32d5eb9a..065560de 100644--- a/src/stores/__tests__/updateStore.test.ts+++ b/src/stores/__tests__/updateStore.test.ts@@ -84,6 +84,20 @@ describe('updateStore', () => {it('handles minor rollover: 1.1.0 < 2.0.0', () => {expect(isNewerVersion('1.1.0', '2.0.0')).toBe(false)})++ // ── diimmortalis regression case (Discord, 2026-04-25) ────+ // The reported display was `Current Version: 2.4.1 | Latest Version: 2.3.8`+ // because a stale persisted snapshot survived an out-of-band binary+ // upgrade. The helper itself was always correct — these assertions pin+ // that behavior so future reshuffles can't reintroduce the inversion.+ it('persisted 2.3.8 is NOT newer than current 2.4.1 (diimmortalis case)', () => {+ expect(isNewerVersion('2.3.8', '2.4.1')).toBe(false)+ expect(isNewerVersion('v2.3.8', 'v2.4.1')).toBe(false)+ })++ it('2.4.1 is newer than 2.3.8 (sanity invert of diimmortalis case)', () => {+ expect(isNewerVersion('2.4.1', '2.3.8')).toBe(true)+ })})// ── checkForUpdate (dev mode — GitHub API) ──────────────────diff --git a/src/stores/updateStore.ts b/src/stores/updateStore.tsindex 2ca56b52..74607fb6 100644--- a/src/stores/updateStore.ts+++ b/src/stores/updateStore.ts@@ -196,6 +196,20 @@ export const useUpdateStore = create<UpdateState>()(releaseNotes: state.releaseNotes,downloadStatus: state.downloadStatus,}),+ // Reset stale persisted state when the binary has been updated out-of-band+ // (e.g. user manually installed a newer .deb / .exe than what the persisted+ // "latest" snapshot remembers). Without this, the Updates tab can show+ // `Current: 2.4.1 | Latest: 2.3.8` indefinitely because checkForUpdate has+ // a 6h cooldown and a stale `latestVersion` survives in localStorage.+ onRehydrateStorage: () => (state) => {+ if (!state) return+ if (state.latestVersion && !isNewerVersion(state.latestVersion, currentVersion)) {+ state.latestVersion = null+ state.updateAvailable = false+ state.releaseNotes = null+ state.lastChecked = null+ }+ },}))