Skip to content

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.

chore(cleanup): remove dead code (unused imports + locals) across v2.5.0

purple4135031c03e6
diff --git a/src/api/agents.ts b/src/api/agents.ts
index fd9b3d8a..0ded4d31 100644
--- a/src/api/agents.ts
+++ b/src/api/agents.ts
@@ -1,4 +1,4 @@
-import type { Tool, ToolName, ToolCall, AgentLogEntry } from "../types/agents";
+import type { Tool, ToolName, AgentLogEntry } from "../types/agents";
import { backendCall, ollamaUrl, localFetch } from "./backend";
export const AGENT_TOOLS: Tool[] = [
diff --git a/src/api/discover.ts b/src/api/discover.ts
index 0db216c1..fefc3f2d 100644
--- a/src/api/discover.ts
+++ b/src/api/discover.ts
@@ -258,7 +258,6 @@ export async function installBundleComplete(bundle: ModelBundle): Promise<void>
// ─── Component Registry: What each model type needs to work ───
-import type { ModelType } from './comfyui'
export interface ComponentSpec {
patterns: string[]
diff --git a/src/api/dynamic-workflow.ts b/src/api/dynamic-workflow.ts
index e9496b6b..30f0ff44 100644
--- a/src/api/dynamic-workflow.ts
+++ b/src/api/dynamic-workflow.ts
@@ -5,7 +5,6 @@ import {
getAllNodeInfo,
categorizeNodes,
detectAvailableModels,
- type NodeMetadata,
type CategorizedNodes,
type AvailableModels,
} from './comfyui-nodes'
diff --git a/src/components/agents/WorkflowBuilder.tsx b/src/components/agents/WorkflowBuilder.tsx
index f43be900..783db215 100644
--- a/src/components/agents/WorkflowBuilder.tsx
+++ b/src/components/agents/WorkflowBuilder.tsx
@@ -4,7 +4,7 @@ import { Plus, Trash2, ChevronUp, ChevronDown, Save, X, ArrowLeft } from 'lucide
import { useAgentWorkflowStore } from '../../stores/agentWorkflowStore'
import { AGENT_TOOL_DEFS } from '../../api/tool-registry'
import { GlowButton } from '../ui/GlowButton'
-import type { WorkflowStep, WorkflowStepType, AgentWorkflow } from '../../types/agent-workflows'
+import type { WorkflowStep, WorkflowStepType } from '../../types/agent-workflows'
import type { MemoryType } from '../../types/agent-mode'
const STEP_TYPE_LABELS: Record<WorkflowStepType, string> = {
diff --git a/src/components/agents/WorkflowList.tsx b/src/components/agents/WorkflowList.tsx
index 80bbd044..5bf53c52 100644
--- a/src/components/agents/WorkflowList.tsx
+++ b/src/components/agents/WorkflowList.tsx
@@ -1,7 +1,6 @@
import { useState } from 'react'
import { Play, Pencil, Trash2, Copy, Plus, Search, FileText, Code, Zap } from 'lucide-react'
import { useAgentWorkflowStore } from '../../stores/agentWorkflowStore'
-import { GlowButton } from '../ui/GlowButton'
import type { AgentWorkflow } from '../../types/agent-workflows'
// Map workflow icon names to Lucide components
diff --git a/src/components/agents/WorkflowRunner.tsx b/src/components/agents/WorkflowRunner.tsx
index 02515207..5d6211ca 100644
--- a/src/components/agents/WorkflowRunner.tsx
+++ b/src/components/agents/WorkflowRunner.tsx
@@ -1,7 +1,6 @@
import { useState } from 'react'
import { Loader2, Check, X, Circle, Send, Square } from 'lucide-react'
import { useAgentWorkflowStore } from '../../stores/agentWorkflowStore'
-import { GlowButton } from '../ui/GlowButton'
import type { StepStatus } from '../../types/agent-workflows'
const STATUS_ICONS: Record<StepStatus | 'waiting', typeof Check> = {
diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx
index eaecdbf1..d28ffd3c 100644
--- a/src/components/chat/ChatView.tsx
+++ b/src/components/chat/ChatView.tsx
@@ -12,8 +12,7 @@ import { AgentModeToggle } from './AgentModeToggle'
import { AgentWorkspaceBadge } from './AgentWorkspaceBadge'
import { ErrorBoundary } from '../ui/ErrorBoundary'
import { useSettingsStore } from '../../stores/settingsStore'
-import { isThinkingCompatible } from '../../lib/model-compatibility'
-import { FileText, ChevronDown, Download, Brain, Wrench, Radio, RefreshCw, X } from 'lucide-react'
+import { FileText, ChevronDown, Download, Wrench, Radio, RefreshCw, X } from 'lucide-react'
import { PluginsDropdown } from './PluginsDropdown'
import { TokenCounter } from './TokenCounter'
import { ContextDropdown } from './ContextDropdown'
@@ -38,10 +37,6 @@ export function ChatView() {
const [exportOpen, setExportOpen] = useState(false)
const [exportToast, setExportToast] = useState<string>('')
const [toolsDropdownOpen, setToolsDropdownOpen] = useState(false)
- const [thinkHint, setThinkHint] = useState('')
- const thinkingEnabled = useSettingsStore((s) => s.settings.thinkingEnabled)
- const canThink = isThinkingCompatible(activeModel)
- const updateSettings = useSettingsStore((s) => s.updateSettings)
const chatMode = useCodexStore((s) => s.chatMode)
const docCount = useRAGStore((s) =>
diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsx
index 86858380..77bdd507 100644
--- a/src/components/chat/CodexView.tsx
+++ b/src/components/chat/CodexView.tsx
@@ -14,7 +14,7 @@ import { TypingIndicator } from './TypingIndicator'
import { useSettingsStore } from '../../stores/settingsStore'
import { useModelStore } from '../../stores/modelStore'
import { StagedChangesPanel } from './StagedChangesPanel'
-import { User, Code, Brain, Eye, GitBranch, Download, RefreshCw, RotateCcw, Folder } from 'lucide-react'
+import { User, Code, Eye, GitBranch, Download, RefreshCw, RotateCcw, Folder } from 'lucide-react'
import { useEffect, useRef, useState } from 'react'
import { checkGitInstalled, openExternal, type GitStatus } from '../../api/backend'
import { extractToolCallsWithRanges, stripRanges } from '../../lib/tool-call-repair'
@@ -90,9 +90,7 @@ export function CodexView() {
}
}, [messages, thread?.events])
- const thinkingEnabled = useSettingsStore((s) => s.settings.thinkingEnabled)
const codexReviewMode = useSettingsStore((s) => s.settings.codexReviewMode)
- const updateSettings = useSettingsStore((s) => s.updateSettings)
const userAvatarDataUrl = useSettingsStore((s) => s.settings.userAvatarDataUrl)
const activeModel = useModelStore((s) => s.activeModel)
const createConversation = useChatStore((s) => s.createConversation)
diff --git a/src/components/chat/ToolCallBlock.tsx b/src/components/chat/ToolCallBlock.tsx
index bb8cab0a..7204d0be 100644
--- a/src/components/chat/ToolCallBlock.tsx
+++ b/src/components/chat/ToolCallBlock.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react'
import { motion, AnimatePresence } from 'framer-motion'
-import { ChevronDown, Search, Globe, FileText, FileEdit, Terminal, Image, Film, Loader2, Check, X, Clock, AlertCircle, FolderOpen, Cpu, Monitor, GitBranch, Database } from 'lucide-react'
+import { Search, Globe, FileText, FileEdit, Terminal, Image, Film, Loader2, Check, X, Clock, AlertCircle, FolderOpen, Cpu, Monitor, GitBranch, Database } from 'lucide-react'
import type { AgentToolCall } from '../../types/agent-mode'
// F1 (konata3602 commitment 2026-05-23) — when image_generate / screenshot
diff --git a/src/components/create/WorkflowFinder.tsx b/src/components/create/WorkflowFinder.tsx
index 51002d50..d5e4d09a 100644
--- a/src/components/create/WorkflowFinder.tsx
+++ b/src/components/create/WorkflowFinder.tsx
@@ -12,7 +12,6 @@ interface Props {
export function WorkflowFinder({ modelName, modelType }: Props) {
const [modalOpen, setModalOpen] = useState(false)
const {
- installedWorkflows,
getWorkflowForModel,
assignToModelName,
unassignModelName,
@@ -21,15 +20,6 @@ export function WorkflowFinder({ modelName, modelType }: Props) {
const activeWorkflow = getWorkflowForModel(modelName, modelType)
- const handleSelect = (workflowId: string) => {
- if (workflowId === 'auto') {
- unassignModelName(modelName)
- unassignModelType(modelType)
- } else {
- assignToModelName(modelName, workflowId)
- }
- }
-
return (
<>
<div>
diff --git a/src/components/create/WorkflowSearchModal.tsx b/src/components/create/WorkflowSearchModal.tsx
index bcf33aaa..e87d900a 100644
--- a/src/components/create/WorkflowSearchModal.tsx
+++ b/src/components/create/WorkflowSearchModal.tsx
@@ -1,4 +1,4 @@
-import { useState, useCallback, useEffect, useRef } from 'react'
+import { useState, useEffect, useRef } from 'react'
import { Search, Upload, Loader2, AlertCircle, Key, Eye, EyeOff } from 'lucide-react'
import { v4 as uuid } from 'uuid'
import { Modal } from '../ui/Modal'
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index e85bfbb8..87b90176 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -22,7 +22,7 @@ export function Sidebar() {
enabled: remoteEnabled, passcode, passcodeExpiresAt, lanUrl, mobileUrl,
qrPngBase64, loading: remoteLoading, error: remoteError,
tunnelActive, tunnelUrl, tunnelLoading,
- qrVisible, showQr, hideQr, refreshDevices,
+ qrVisible, hideQr, refreshDevices,
dispatchedConversationId, dispatch, undispatch, regenerateToken, restart,
} = useRemoteStore()
const [search, setSearch] = useState('')
diff --git a/src/components/layout/UpdateBadge.tsx b/src/components/layout/UpdateBadge.tsx
index fbce9e7a..a59f1fd8 100644
--- a/src/components/layout/UpdateBadge.tsx
+++ b/src/components/layout/UpdateBadge.tsx
@@ -17,7 +17,6 @@ export function UpdateBadge() {
downloadedBytes,
totalBytes,
errorMessage,
- checkForUpdate,
downloadUpdate,
installAndRestart,
dismissUpdate,
diff --git a/src/components/onboarding/Onboarding.tsx b/src/components/onboarding/Onboarding.tsx
index 19309d8b..0b6256ed 100644
--- a/src/components/onboarding/Onboarding.tsx
+++ b/src/components/onboarding/Onboarding.tsx
@@ -1,9 +1,9 @@
import { useState, useEffect } from 'react'
import { motion, AnimatePresence } from 'framer-motion'
-import { Minus, Square, Copy, X as XIcon, ArrowRight, Download, Check, ChevronRight, Loader2, RefreshCw, ExternalLink, FolderOpen } from 'lucide-react'
+import { Minus, Square, X as XIcon, ArrowRight, Download, Check, ChevronRight, Loader2, RefreshCw, ExternalLink, FolderOpen } from 'lucide-react'
import { useSettingsStore } from '../../stores/settingsStore'
import { useProviderStore } from '../../stores/providerStore'
-import { ONBOARDING_MODELS, type OnboardingModel } from '../../lib/constants'
+import { ONBOARDING_MODELS } from '../../lib/constants'
import { PROVIDER_PRESETS } from '../../api/providers/types'
import { detectLocalBackends, type DetectedBackend } from '../../lib/backend-detector'
import { detectProviderModelPath, startModelDownloadToPath } from '../../api/discover'
@@ -104,7 +104,7 @@ export function Onboarding() {
const [pythonInstalling, setPythonInstalling] = useState(false)
const [pythonInstallLogs, setPythonInstallLogs] = useState<string[]>([])
const [pythonInstallError, setPythonInstallError] = useState('')
- const [pythonReady, setPythonReady] = useState(false)
+ const [, setPythonReady] = useState(false)
const [pythonStartTime, setPythonStartTime] = useState<number | null>(null)
const [pythonElapsed, setPythonElapsed] = useState(0)
const [systemVRAM, setSystemVRAM] = useState<number | null>(null)
diff --git a/src/components/settings/MCPServerSettings.tsx b/src/components/settings/MCPServerSettings.tsx
index 5ab5ea99..3f9a4d62 100644
--- a/src/components/settings/MCPServerSettings.tsx
+++ b/src/components/settings/MCPServerSettings.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react'
import { v4 as uuid } from 'uuid'
-import { Plus, Trash2, Power, PowerOff, ChevronDown } from 'lucide-react'
+import { Plus, Trash2, Power, PowerOff } from 'lucide-react'
import { useMCPStore } from '../../stores/mcpStore'
import { toolRegistry } from '../../api/mcp'
import type { MCPServerConfig } from '../../api/mcp/types'
diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsx
index 6a32226e..3987732e 100644
--- a/src/components/settings/SettingsPage.tsx
+++ b/src/components/settings/SettingsPage.tsx
@@ -20,7 +20,6 @@ const PIPER_VOICES: { id: string; label: string }[] = [
]
import { useAgentModeStore } from '../../stores/agentModeStore'
import { FEATURE_FLAGS } from '../../lib/constants'
-import { getRecommendedAgentModels } from '../../lib/model-compatibility'
import { MemorySettings } from './MemorySettings'
import { RemoteAccessSettings } from './RemoteAccessSettings'
import { RemoteAccessDocs } from './RemoteAccessDocs'
diff --git a/src/hooks/useAgent.ts b/src/hooks/useAgent.ts
index 903adb0b..9e32edef 100644
--- a/src/hooks/useAgent.ts
+++ b/src/hooks/useAgent.ts
@@ -10,7 +10,6 @@ import {
} from "../api/agents";
import type {
AgentRun,
- AgentLogEntry,
ToolCall,
ToolName,
} from "../types/agents";
diff --git a/src/hooks/useAgentChat.ts b/src/hooks/useAgentChat.ts
index 9610cd3c..f8fdbf3d 100644
--- a/src/hooks/useAgentChat.ts
+++ b/src/hooks/useAgentChat.ts
@@ -17,8 +17,6 @@ import { speakStreaming, isSpeechSynthesisSupported, getVoicesAsync } from '../a
import { toolRegistry } from '../api/mcp'
import { usePermissionStore } from '../stores/permissionStore'
import { isThinkingCompatible, isPlainTextPlanner } from '../lib/model-compatibility'
-// Legacy compat imports (still used by some callers)
-import { getToolPermission, executeAgentTool, AGENT_TOOL_DEFS } from '../api/tool-registry'
import { getToolCallingStrategy, type ToolCallingStrategy } from '../lib/model-compatibility'
import { log } from '../lib/logger'
import { buildHermesToolPrompt, buildHermesToolResult, parseHermesToolCalls, stripToolCallTags, hasToolCallTags } from '../api/hermes-tool-calling'
@@ -33,7 +31,7 @@ import { buildExtractionPrompt, parseExtractionResponse } from '../lib/memory-ex
import { useAgentWorkflowStore } from '../stores/agentWorkflowStore'
import { WorkflowEngine } from '../lib/workflow-engine'
import type { AgentBlock, AgentToolCall, OllamaChatMessage } from '../types/agent-mode'
-import { selectRelevantTools, selectRelevantToolsAsync } from '../lib/tool-selection'
+import { selectRelevantToolsAsync } from '../lib/tool-selection'
import { generateEmbeddings } from '../api/rag'
import { truncateToolResult } from '../lib/truncate-tool-result'
import { budgetFromSettings } from '../api/agents/budget'
@@ -138,15 +136,6 @@ export function useAgentChat() {
useChatStore.getState().updateMessageAgentBlocks(convId, msgId, blocksRef.current)
}
- function updateLastBlock(convId: string, msgId: string, updates: Partial<AgentBlock>) {
- const blocks = [...blocksRef.current]
- const last = blocks[blocks.length - 1]
- if (last) {
- blocks[blocks.length - 1] = { ...last, ...updates }
- blocksRef.current = blocks
- useChatStore.getState().updateMessageAgentBlocks(convId, msgId, blocks)
- }
- }
/**
* ID-keyed block update — used by the parallel tool executor (Phase 5) so
diff --git a/src/hooks/useChat.ts b/src/hooks/useChat.ts
index 34adbd22..3b022b5b 100644
--- a/src/hooks/useChat.ts
+++ b/src/hooks/useChat.ts
@@ -18,7 +18,6 @@ import { getProviderForModel, getProviderIdFromModel } from "../api/providers"
import { syncOllamaHealthFromError } from "../lib/sync-ollama-health"
import { isThinkingCompatible, isPlainTextPlanner } from "../lib/model-compatibility"
import { stripNonCanonicalTags, finalStripThinkingTags } from "../lib/thinking-stripper"
-import type { ChatStreamChunk } from "../api/providers/types"
import type { ImageAttachment } from "../types/chat"
import { log } from "../lib/logger"
diff --git a/src/hooks/useCodex.ts b/src/hooks/useCodex.ts
index e43f289a..3529ed44 100644
--- a/src/hooks/useCodex.ts
+++ b/src/hooks/useCodex.ts
@@ -21,7 +21,6 @@ import { isLocalModelByName } from '../api/agents/model-locality'
import { useStagedChangesStore } from '../stores/stagedChangesStore'
import { computeUnifiedDiff } from '../lib/diff'
import { log } from '../lib/logger'
-import type { CodexEvent } from '../types/codex'
import type { AgentBlock, AgentToolCall } from '../types/agent-mode'
import { isThinkingCompatible, isPlainTextPlanner } from '../lib/model-compatibility'
import type { ChatMessage, ToolCall, ToolDefinition } from '../api/providers/types'
@@ -32,7 +31,7 @@ import { explainError as explainToolError } from '../api/agents/error-hints'
import { budgetFromSettings } from '../api/agents/budget'
import { finalStripThinkingTags } from '../lib/thinking-stripper'
import { streamOllamaChatWithTools } from '../lib/ollama-stream-tools'
-import { repairToolCallArgs, extractToolCallsFromContent, extractToolCallsWithRanges, stripRanges } from '../lib/tool-call-repair'
+import { extractToolCallsWithRanges, stripRanges } from '../lib/tool-call-repair'
import { selectRelevantTools, selectRelevantToolsAsync } from '../lib/tool-selection'
import { generateEmbeddings } from '../api/rag'
import { truncateToolResult } from '../lib/truncate-tool-result'
diff --git a/src/lib/workflow-engine.ts b/src/lib/workflow-engine.ts
index 4bc3b3fe..520f6481 100644
--- a/src/lib/workflow-engine.ts
+++ b/src/lib/workflow-engine.ts
@@ -5,13 +5,12 @@
* Supports: prompt, tool, condition, loop, user_input, memory_save steps.
*/
-import { v4 as uuid } from 'uuid'
import { useModelStore } from '../stores/modelStore'
import { useSettingsStore } from '../stores/settingsStore'
import { useMemoryStore } from '../stores/memoryStore'
import { getOllamaTools, executeAgentTool } from '../api/tool-registry'
import { chatNonStreaming } from '../api/agents'
-import { buildHermesToolPrompt, buildHermesToolResult, parseHermesToolCalls, stripToolCallTags, hasToolCallTags } from '../api/hermes-tool-calling'
+import { buildHermesToolPrompt, parseHermesToolCalls, stripToolCallTags, hasToolCallTags } from '../api/hermes-tool-calling'
import { resolveToolCallingStrategy } from './agent-strategy'
import type { AgentWorkflow, WorkflowStep, StepResult, WorkflowEngineCallbacks } from '../types/agent-workflows'
import type { ChatMessage, ToolDefinition } from '../api/providers/types'
diff --git a/src/stores/agentStore.ts b/src/stores/agentStore.ts
index 6ad352c8..cd4aa87e 100644
--- a/src/stores/agentStore.ts
+++ b/src/stores/agentStore.ts
@@ -2,7 +2,6 @@ import { create } from "zustand";
import { persist } from "zustand/middleware";
import type {
AgentRun,
- AgentStatus,
AgentLogEntry,
ToolCall,
} from "../types/agents";