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(chat): normaler Chat zeigt den Weg zum Agent, wenn er Dateien lesen soll
purple4232e628ff4e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bda73fee..129fd7b3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -49,7 +49,10 @@ hold: fourteen video models and seven image models in the cloud catalogue.Agent now always shows where the agent works, Sandbox included, and one clickleads to "Pick a folder…". When a file is refused because it is outside thatfolder, a line above the chat says what to do, and the model gets the same- hint. In Settings, Filesystem no longer claims to reach files anywhere.+ hint. Plain chat has no tool that reads your files, and asking it for one+ used to end with the model saying it cannot. It now brings up a line that+ says to turn on Agent. In Settings, Filesystem no longer claims to reach+ files anywhere.- **Typing in the prompt box no longer lags in long chats** (issue 139). Eachkey made the page lay out the whole visible chat twice to size the box, sothe delay grew with the conversation. The box is now measured on a hiddendiff --git a/src/components/chat/AgentModeToggle.tsx b/src/components/chat/AgentModeToggle.tsxindex e8f380fc..7278484e 100644--- a/src/components/chat/AgentModeToggle.tsx+++ b/src/components/chat/AgentModeToggle.tsx@@ -6,6 +6,7 @@ import { useAgentModeStore } from '../../stores/agentModeStore'import { useChatStore } from '../../stores/chatStore'import { useModelStore } from '../../stores/modelStore'import { useSettingsStore } from '../../stores/settingsStore'+import { useChatNoticeStore } from '../../stores/chatNoticeStore'import { canUseTools } from '../../lib/tool-support'import { FEATURE_FLAGS } from '../../lib/constants'import { AgentWorkspaceDialog } from './AgentWorkspaceDialog'@@ -112,6 +113,8 @@ export function AgentModeToggle() {const persona = useSettingsStore.getState().getActivePersona()const newId = createConversation(activeModel, persona?.systemPrompt || '')useAgentModeStore.getState().toggleAgentMode(newId)+ // Die Zeile "Plain chat cannot open files" hat ihren Rat gegeben.+ useChatNoticeStore.getState().dismiss('agent-for-local-files')void maybeOpenWorkspaceDialog(newId)}@@ -134,7 +137,10 @@ export function AgentModeToggle() {toggleAgentMode(activeConversationId)// If the user just turned agent ON (was inactive, now active) and// hasn't picked a workspace for this conversation, prompt for one.- if (!isActive) void maybeOpenWorkspaceDialog(activeConversationId)+ if (!isActive) {+ useChatNoticeStore.getState().dismiss('agent-for-local-files')+ void maybeOpenWorkspaceDialog(activeConversationId)+ }}const handleNewAgentChat = () => {diff --git a/src/components/chat/ChatNotices.tsx b/src/components/chat/ChatNotices.tsxindex 921efd95..e10ba57b 100644--- a/src/components/chat/ChatNotices.tsx+++ b/src/components/chat/ChatNotices.tsx@@ -11,7 +11,7 @@* fuer Anmerkungen und Fehler vorschreibt: eine Zeile, kein Kasten, ruhiges* Grau oder Rot, und ein x, das sie wegnimmt.*/-import { FolderOpen, ImageOff, Images, Paperclip } from 'lucide-react'+import { Bot, FolderOpen, ImageOff, Images, Paperclip } from 'lucide-react'import { Hinweis } from '../ui/Hinweis'import { useChatNoticeStore, type ChatNoticeId } from '../../stores/chatNoticeStore'import { COMPOSER_MAX_W } from './composer-width'@@ -22,6 +22,7 @@ const ICON: Record<ChatNoticeId, typeof Paperclip> = {'model-cannot-see-images': ImageOff,'image-attach': Images,'agent-outside-workspace': FolderOpen,+ 'agent-for-local-files': Bot,}interface Props {diff --git a/src/hooks/useChat.ts b/src/hooks/useChat.tsindex 226a6fae..8433b1f5 100644--- a/src/hooks/useChat.ts+++ b/src/hooks/useChat.ts@@ -33,6 +33,8 @@ import { useGenerationStore } from "../stores/generationStore"import { runInLane } from "../lib/run-slot"import { laneOf, currentLaneFacts } from "../lib/run-lane-of-model"import { resolveChatToolRoute, CHAT_TOOLS, type ChatToolRouteMsg } from "../lib/chat-tool-intent"+import { asksForLocalFiles, LOCAL_FILES_NOTICE } from "../lib/local-file-intent"+import { useChatNoticeStore } from "../stores/chatNoticeStore"import { getProviderForModel, getProviderIdFromModel } from "../api/providers"import { modelOutOfMode } from "../lib/modeGate"import { syncOllamaHealthFromError } from "../lib/sync-ollama-health"@@ -644,6 +646,8 @@ export function useChat() {// like it does in Code. In PLAIN chat (no agent mode) a "/cmd" is still just// text: there is no tool catalog there for the templates to drive.if (store.activeConversationId && useAgentModeStore.getState().isActive(store.activeConversationId)) {+ // Der Rat aus der Zeile unten ist befolgt, sobald im Agent gefragt wird.+ useChatNoticeStore.getState().dismiss('agent-for-local-files')const slash = parseAgentCommand(content)if (slash?.command.handledLocally && slash.command.name === 'goal') {// Bookkeeping, not a prompt — never spend a round-trip on it.@@ -671,6 +675,15 @@ export function useChat() {return sendAgentMessage(content, images)}+ // Discord 28.09.2026 (xambran): im normalen Chat liest kein Werkzeug die+ // Dateien dieses Rechners, auch nicht mit Chat Tools, und das Modell sagt+ // dann nur "I cannot access files". Die Zeile ueber dem Verlauf nennt den+ // Weg dorthin (lib/local-file-intent.ts). Gesendet wird trotzdem, die Zeile+ // ersetzt keine Antwort.+ if (asksForLocalFiles(content)) {+ useChatNoticeStore.getState().show('agent-for-local-files', LOCAL_FILES_NOTICE)+ }+// Group chat v1 (Nurse KillJoy): two to four models answer in turn in// ONE conversation. Runs BEFORE the chat-tools router on purpose: a// group round is a conversation, never a tool run, and the agent pathdiff --git a/src/lib/__tests__/local-file-intent.test.ts b/src/lib/__tests__/local-file-intent.test.tsnew file mode 100644index 00000000..07ee6f87--- /dev/null+++ b/src/lib/__tests__/local-file-intent.test.ts@@ -0,0 +1,104 @@+/**+ * Discord 2026-09-28 (xambran): every agent permission on Auto, and the model+ * still said it could not access his files. Replayed on the installed 3.0.3 on+ * lu-box: in plain chat the request never reaches a tool, because Chat Tools+ * carry no file_read. The chat now says that the agent reads files, and how to+ * turn it on.+ */+import { readFileSync } from 'node:fs'+import { join } from 'node:path'+import { describe, expect, it } from 'vitest'+import { asksForLocalFiles, LOCAL_FILES_NOTICE } from '../local-file-intent'+import { CHAT_TOOLS } from '../chat-tool-intent'++const root = join(__dirname, '..', '..', '..')+const read = (p: string) => readFileSync(join(root, p), 'utf8')++describe('a request to read files on this computer is recognised', () => {+ it.each([+ // The sentence replayed on the box, word for word.+ 'Read the file C:\\Windows\\win.ini and tell me its first line.',+ 'can you access my files?',+ 'Open my documents folder and tell me what is in it',+ 'please look at the files on my desktop',+ 'list the files in my Downloads folder',+ 'summarize D:/notes/meeting.txt',+ 'scan ~/projects for TODO comments',+ 'read /home/sam/notes.md',+ 'check \\\\nas\\share\\report.docx',+ 'lies die Datei C:\\Users\\x\\notizen.txt',+ 'kannst du auf meine Dateien zugreifen?',+ 'öffne meinen Ordner Bilder',+ 'schau dir die Dateien auf meinem PC an',+ ])('%s', (msg) => {+ expect(asksForLocalFiles(msg)).toBe(true)+ })+})++describe('and nothing else', () => {+ it.each([+ 'hi',+ 'What is a file system?',+ 'How do I open a file in Python?',+ 'Write a file called notes.txt with a todo list',+ 'Create a markdown file with my shopping list',+ // A pasted stack trace is full of paths and asks for nothing.+ 'My script crashes: File "C:\\Users\\x\\app.py", line 3, in <module>',+ 'summarize https://example.com/home/news/today',+ 'read www.example.org/home/index.html',+ // Documents attached through Docs are read by the chat itself.+ 'summarize my documents',+ 'read my mind',+ // Hardware, not files.+ 'Why does my computer see only 8 GB of RAM?',+ 'check my laptop battery',+ 'meine Festplatte ist voll, schau mal was ich tun kann',+ 'Wie spät ist es?',+ '',+ ])('%s', (msg) => {+ expect(asksForLocalFiles(msg)).toBe(false)+ })+})++describe('the line the user gets', () => {+ it('names the buttons as they are labelled', () => {+ expect(read('src/components/chat/AgentModeToggle.tsx')).toContain('<span>Agent</span>')+ expect(read('src/components/chat/AgentWorkspaceDialog.tsx')).toContain("'Pick a folder…'")+ expect(LOCAL_FILES_NOTICE).toContain('Turn on Agent')+ expect(LOCAL_FILES_NOTICE).toContain('"Pick a folder…"')+ })++ it('carries no dash and no curly quote', () => {+ expect(LOCAL_FILES_NOTICE).not.toMatch(/[\u2013\u2014\u201c\u201d\u2018\u2019]/)+ })++ it('rests on plain chat having no tool that reads files', () => {+ // If Chat Tools ever get file_read, this line would be wrong: revisit it.+ expect(CHAT_TOOLS as readonly string[]).not.toContain('file_read')+ expect(CHAT_TOOLS as readonly string[]).not.toContain('file_list')+ })+})++describe('where the line comes and goes', () => {+ const chat = read('src/hooks/useChat.ts')+ const toggle = read('src/components/chat/AgentModeToggle.tsx')++ it('plain chat shows it, after the agent branch has returned and before the Chat Tools route', () => {+ const show = chat.indexOf("show('agent-for-local-files', LOCAL_FILES_NOTICE)")+ expect(show).toBeGreaterThan(0)+ expect(chat).toContain('if (asksForLocalFiles(content)) {')+ expect(show).toBeGreaterThan(chat.indexOf('return sendAgentMessage(content, images)'))+ expect(show).toBeLessThan(chat.indexOf('resolveChatToolRoute(content'))+ })++ it('a send in agent mode takes it away', () => {+ const agentBranch = chat.indexOf('useAgentModeStore.getState().isActive(store.activeConversationId)')+ const dismiss = chat.indexOf("dismiss('agent-for-local-files')")+ expect(dismiss).toBeGreaterThan(agentBranch)+ expect(dismiss).toBeLessThan(chat.indexOf('return sendAgentMessage(content, images)'))+ })++ it('turning Agent on takes it away, in a new agent chat and in this one', () => {+ expect(toggle.split("dismiss('agent-for-local-files')").length - 1).toBe(2)+ })+})diff --git a/src/lib/local-file-intent.ts b/src/lib/local-file-intent.tsnew file mode 100644index 00000000..92563692--- /dev/null+++ b/src/lib/local-file-intent.ts@@ -0,0 +1,51 @@+/**+ * Discord 28.09.2026 (xambran, Windows 11, Ollama mit Qwen und DeepSeek): "I+ * still can't get my models to access the files", jede Agent-Berechtigung auf+ * Auto. Nachgestellt am installierten 3.0.3 auf lu-box: im normalen Chat fuehrt+ * "Read the file C:\Windows\win.ini and tell me its first line." zu keinem+ * einzigen Werkzeugaufruf. Das ist Absicht, Chat Tools haben kein file_read+ * (`CHAT_TOOLS` in chat-tool-intent.ts: Web, Datei SCHREIBEN als Anhang, Bild,+ * Video). Das Modell antwortete "I cannot access or read files on your local+ * system", und nichts in der App sagte, dass genau das der Agent kann.+ *+ * Erkannt wird hier die Bitte, eine Datei oder einen Ordner auf DIESEM Rechner+ * zu lesen, damit der Chat den Weg zum Agent zeigt. Entschieden wird nichts,+ * gesetzt wird nur eine Zeile ueber dem Verlauf. Deshalb lieber eine Bitte+ * verpassen als eine Zeile zu viel: es braucht immer ein Leseverb, dazu einen+ * Pfad auf diesem Rechner oder "meine Dateien" und Verwandte. Ein Pfad allein+ * reicht nicht, denn ein eingefuegter Stacktrace ist voller Pfade und bittet um+ * nichts. "Dokumente" zaehlt nicht, das sind in dieser App oft die ueber Docs+ * angehaengten, und die liest der Chat sehr wohl. Und "mein Rechner" allein+ * auch nicht: "why does my computer see only 8 GB" fragt nach Hardware.+ */+import { entumlauten } from './chat-tool-intent'++// Adressen im Netz vorher heraus, damit "/home/" in einer URL kein Pfad wird.+const URL_RE = /\bhttps?:\/\/\S+|\bwww\.\S+/gi++// Laufwerk (C:\, D:/), UNC-Freigabe (\\server\), Heimordner (~/) und die+// ueblichen Wurzeln unter Linux, jeweils am Wortanfang.+const LOCAL_PATH_RE = /(?:^|[\s"'`(<[])(?:[a-z]:[\\/]|\\\\[\w.$-]+\\|~[\\/]|\/(?:home|users|mnt|media|tmp|etc|var|opt|srv|root)\/)/i++const READ_VERB_RE = /\b(?:read|open|access|view|see|look\s+(?:at|in|into|through)|check|scan|browse|analy[sz]e|summari[sz]e|go\s+through|search|find|list|load|lies|lese|lesen|oeffne|oeffnen|zugreifen|zugriff|durchsuche|durchsuchen|schau|anschauen|analysiere|analysieren)\b/i++// Regex-Literale und nicht String.raw: ein Zeichenkettenliteral mit deutschen+// Woertern haelt keine-deutschen-saetze-in-der-oberflaeche.test.ts fuer+// Oberflaechentext.+const MY_FILES_RE = new RegExp([+ /\b(?:my|local)\s+(?:own\s+)?(?:files?|(?:documents\s+|downloads\s+)?folders?|director(?:y|ies)|downloads)\b/.source,+ /\bfiles?\s+(?:on|in|from)\s+(?:my|this)\s+(?:pc|computer|laptop|machine|drive|disk|desktop|system|folder)\b/.source,+ /\b(?:meine[nmrs]?|lokale[nmrs]?)\s+(?:dateien|datei|ordner|downloads)\b/.source,+ /\bdateien\s+(?:auf|in|von)\s+(?:meinem|diesem)\s+(?:pc|rechner|laptop|computer|ordner|desktop)\b/.source,+].join('|'), 'i')++/** Bittet diese Nachricht darum, eine Datei oder einen Ordner auf diesem Rechner zu lesen? */+export function asksForLocalFiles(message: string): boolean {+ const t = entumlauten((message || '').toLowerCase()).replace(URL_RE, ' ')+ if (!READ_VERB_RE.test(t)) return false+ return LOCAL_PATH_RE.test(t) || MY_FILES_RE.test(t)+}++/** Die Zeile ueber dem Verlauf. Nennt die Knoepfe so, wie sie heissen. */+export const LOCAL_FILES_NOTICE =+ 'Plain chat cannot open files on this computer. Turn on Agent above the message box, choose "Pick a folder…" and select the folder that holds them, then ask again. Agent needs a model that can use tools.'diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.tsindex efd3af68..d1b95010 100644--- a/src/lib/release-notes.ts+++ b/src/lib/release-notes.ts@@ -199,7 +199,7 @@ export const RELEASE_NOTES: ReleaseNote[] = [items: [{title: 'The agent shows which folder it works in, and how to reach your files.',- detail: 'Setting every agent permission to Auto never let the agent open files outside the chat\'s working folder, and a dismissed folder dialog left it in its own sandbox without a sign. The button next to Agent now always shows where the agent works, Sandbox included, and one click leads to "Pick a folder…". A file refused for being outside that folder brings up a line above the chat that says what to do, and Settings no longer says Filesystem reaches files anywhere.',+ detail: 'Setting every agent permission to Auto never let the agent open files outside the chat\'s working folder, and a dismissed folder dialog left it in its own sandbox without a sign. The button next to Agent now always shows where the agent works, Sandbox included, and one click leads to "Pick a folder…". A file refused for being outside that folder brings up a line above the chat that says what to do, and Settings no longer says Filesystem reaches files anywhere. Plain chat has no tool that reads your files, so asking it for one now brings up a line that says to turn on Agent.',},{title: 'A /loop pass that ends early no longer leaves the loop running.',diff --git a/src/stores/__tests__/releaseNotesStore.test.ts b/src/stores/__tests__/releaseNotesStore.test.tsindex 838a6281..c24c7b61 100644--- a/src/stores/__tests__/releaseNotesStore.test.ts+++ b/src/stores/__tests__/releaseNotesStore.test.ts@@ -367,6 +367,7 @@ describe('the notes table', () => {'issue 143', 'model storage folder', 'comfyui path not set',// Der Agent und sein Arbeitsordner (Discord 28.09.2026).'the button next to agent', 'pick a folder', 'no longer says filesystem reaches files anywhere',+ 'plain chat has no tool that reads your files', 'says to turn on agent',]) {expect(prose, `${shipping}: nothing about "${anchor}"`).toContain(anchor)}diff --git a/src/stores/chatNoticeStore.ts b/src/stores/chatNoticeStore.tsindex 3262eed4..719b0e78 100644--- a/src/stores/chatNoticeStore.ts+++ b/src/stores/chatNoticeStore.ts@@ -33,7 +33,7 @@ import type { HinweisTon } from '../lib/hinweis'/** Die Zeilen, die es gibt. Kein freier Schluessel: eine Aufzaehlung laesst* sich nachzaehlen, ein String-Schluessel waechst unbemerkt. */-export type ChatNoticeId = 'attachment-is-not-an-image' | 'model-cannot-see-images' | 'image-attach' | 'agent-outside-workspace'+export type ChatNoticeId = 'attachment-is-not-an-image' | 'model-cannot-see-images' | 'image-attach' | 'agent-outside-workspace' | 'agent-for-local-files'export interface ChatNotice {id: ChatNoticeId