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(code): die Freigabekarte bleibt erreichbar, Apply all schreibt in den Ordner des Laufs
David1d7fbe92209f
diff --git a/src-tauri/src/python.rs b/src-tauri/src/python.rsindex b0db7621..54f88f15 100644--- a/src-tauri/src/python.rs+++ b/src-tauri/src/python.rs@@ -911,4 +911,23 @@ mod tests {assert!(launcher_list_paths("").is_empty());assert!(launcher_list_paths("no launcher here\n").is_empty());}++ // Ticket 0004, sockenmonster, 2026-09-06: his machine runs the new Python+ // install manager, whose `py -0p` prints the tag with a bitness suffix in+ // brackets. The path after the star is what matters, and it is read.+ #[test]+ fn the_install_manager_listing_with_its_bracketed_tag_is_read_too() {+ let listing = "-V:3.14[-64] * C:\\Users\\milan\\AppData\\Local\\Python\\pythoncore-3.14-64\\python.exe\n";+ assert_eq!(+ launcher_list_paths(listing),+ vec!["C:\\Users\\milan\\AppData\\Local\\Python\\pythoncore-3.14-64\\python.exe"]+ );+ // and that Python is outside the trainer's range, so the winget step runs+ assert!(!crate::commands::trainer::trainer_supports_python("3.14.6"));+ assert!(crate::commands::trainer::choose_trainer_python(&[(+ "C:\\Users\\milan\\AppData\\Local\\Python\\pythoncore-3.14-64\\python.exe".to_string(),+ "3.14.6".to_string(),+ )])+ .is_none());+ }}diff --git a/src/components/chat/CodexConfirmDialog.tsx b/src/components/chat/CodexConfirmDialog.tsxindex 5cf8fb25..a4757f8e 100644--- a/src/components/chat/CodexConfirmDialog.tsx+++ b/src/components/chat/CodexConfirmDialog.tsx@@ -11,6 +11,7 @@// caused the prompt. Clearing without allowing would leave the task blocked on// a question that will not be asked again, which is not what the phrase means.+import { useEffect, useRef } from 'react'import { Terminal } from 'lucide-react'import { useCodexConfirmStore } from '../../stores/codexConfirmStore'import { useSettingsStore } from '../../stores/settingsStore'@@ -19,6 +20,15 @@ export function CodexConfirmDialog() {const pending = useCodexConfirmStore((s) => s.pending)const answer = useCodexConfirmStore((s) => s.answer)const updateSettings = useSettingsStore((s) => s.updateSettings)+ const card = useRef<HTMLDivElement>(null)++ // The card is the one thing the run waits for, so it must be on screen the+ // moment it exists. The transcript's auto-scroll only follows while the+ // reader sits near the bottom; a reader who scrolled up to check the plan+ // never saw the card and the run looked stuck (t10, 2026-09-06).+ useEffect(() => {+ if (pending) card.current?.scrollIntoView({ block: 'nearest' })+ }, [pending])if (!pending) return null@@ -32,7 +42,7 @@ export function CodexConfirmDialog() {}return (- <div className="px-1 py-0.5" data-codex-confirm>+ <div ref={card} className="px-1 py-0.5" data-codex-confirm><div className="rounded-lg border border-purple-500/20 bg-purple-500/[0.04] px-2 py-1.5"><div className="flex items-center gap-1.5 t-micro text-gray-700 dark:text-gray-300"><Terminal size={10} className="text-purple-400 shrink-0" />diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsxindex 9b55bd27..ebbf3ee4 100644--- a/src/components/chat/CodexView.tsx+++ b/src/components/chat/CodexView.tsx@@ -279,7 +279,7 @@ export function CodexView() {<StagedChangesPanel chatId={activeConversationId} />{/* Messages */}- <div ref={scrollRef} className="flex-1 overflow-y-auto scrollbar-thin">+ <div ref={scrollRef} className="flex-1 min-h-[10rem] overflow-y-auto scrollbar-thin" data-testid="codex-transcript">{messages.length === 0 ? (<div className="flex flex-col items-center justify-center h-full text-center"><Code size={28} className="text-gray-300 dark:text-gray-700 mb-2" />diff --git a/src/components/chat/StagedChangesPanel.tsx b/src/components/chat/StagedChangesPanel.tsxindex c52c1280..3d077cbe 100644--- a/src/components/chat/StagedChangesPanel.tsx+++ b/src/components/chat/StagedChangesPanel.tsx@@ -99,7 +99,7 @@ export function StagedChangesPanel({ chatId }: Props) {// Liste, die auf einen Klick wartet: sie traegt jetzt dieselbe neutrale// Haut wie die uebrigen Abschnitte der Spalte, und die Zahl daneben ist// das Signal (`lib/hinweis.ts`).- <div className="border-b border-gray-200 dark:border-white/[0.04]">+ <div className="shrink-0 border-b border-gray-200 dark:border-white/[0.04]" data-testid="staged-changes-panel"><buttononClick={() => setExpanded(!expanded)}className="w-full flex items-center justify-between px-2 py-1.5 group hover:bg-gray-100/70 dark:hover:bg-white/[0.04] transition-colors"@@ -118,8 +118,14 @@ export function StagedChangesPanel({ chatId }: Props) {</span></button>+ {/* The list scrolls inside a cap of the column. Without the cap two+ staged files with long diffs took the whole column and the+ transcript below shrank to zero height, so the shell approval+ card that followed sat behind the composer with no way to reach+ it (t10 on the box, 2026-09-06: run parked on "Waiting for your+ approval" for 15 minutes). */}{expanded && (- <div className="px-1.5 pb-2 space-y-1.5">+ <div className="px-1.5 pb-2 space-y-1.5 max-h-[40vh] overflow-y-auto scrollbar-thin" data-testid="staged-changes-list">{changes.map((change) => {const isApplying = applying.has(change.id)return (diff --git a/src/components/chat/__tests__/die-karte-bleibt-erreichbar.test.ts b/src/components/chat/__tests__/die-karte-bleibt-erreichbar.test.tsnew file mode 100644index 00000000..a1014c68--- /dev/null+++ b/src/components/chat/__tests__/die-karte-bleibt-erreichbar.test.ts@@ -0,0 +1,49 @@+/**+ * t10 on the box (2026-09-06, GLM 5.3, Plan mode, "Approve and run (Ask)"):+ * two staged files filled the whole coding column, the transcript below shrank+ * to a height of zero, and the shell approval card of step 3 sat behind the+ * composer where no scroll could reach it. The run waited 15 minutes on+ * "Waiting for your approval" and the customer read it as "stuck at step 2".+ *+ * Four source contracts keep that from coming back:+ * 1. the Pending list is capped and scrolls inside itself,+ * 2. the transcript keeps a floor,+ * 3. the approval card scrolls itself into view when it appears,+ * 4. the Bypass description does not promise a cloud confirm that is off by+ * default (settings.codexCloudConfirmOptIn = false).+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'node:fs'+import { resolve } from 'node:path'++const read = (rel: string) => readFileSync(resolve(__dirname, rel), 'utf8')++describe('the approval card stays reachable', () => {+ it('caps the Pending list inside the column and lets it scroll on its own', () => {+ const src = read('../StagedChangesPanel.tsx')+ const list = src.slice(src.indexOf('data-testid="staged-changes-list"') - 200, src.indexOf('data-testid="staged-changes-list"'))+ expect(list).toMatch(/max-h-\[40vh\]/)+ expect(list).toMatch(/overflow-y-auto/)+ // The panel itself never grows at the transcript's expense.+ expect(src).toMatch(/className="shrink-0 border-b[^"]*" data-testid="staged-changes-panel"/)+ })++ it('gives the transcript a floor so no side panel can squeeze it to nothing', () => {+ const src = read('../CodexView.tsx')+ expect(src).toMatch(/ref=\{scrollRef\} className="flex-1 min-h-\[10rem\] overflow-y-auto[^"]*" data-testid="codex-transcript"/)+ })++ it('scrolls the approval card into view the moment it exists', () => {+ const src = read('../CodexConfirmDialog.tsx')+ expect(src).toMatch(/useEffect\(\(\) => \{\s*if \(pending\) card\.current\?\.scrollIntoView\(\{ block: 'nearest' \}\)\s*\}, \[pending\]\)/)+ expect(src).toMatch(/<div ref=\{card\} className="px-1 py-0\.5" data-codex-confirm>/)+ })++ it('does not describe Bypass with a cloud confirm that is off by default', () => {+ const modes = read('../../../lib/codex-mode.ts')+ expect(modes).not.toMatch(/Cloud shell still confirms/)+ expect(modes).toMatch(/bypass: 'Run without asking\. Commands and edits land as they come'/)+ const defaults = read('../../../lib/constants.ts')+ expect(defaults).toMatch(/codexCloudConfirmOptIn: false/)+ })+})diff --git a/src/lib/__tests__/staged-apply.test.ts b/src/lib/__tests__/staged-apply.test.tsindex 7e3815d5..1a6ff12d 100644--- a/src/lib/__tests__/staged-apply.test.ts+++ b/src/lib/__tests__/staged-apply.test.ts@@ -15,9 +15,14 @@ vi.mock('../../stores/chatStore', () => ({import { backendCall } from '../../api/backend'import { applyStagedChange, applyAllStagedChanges } from '../staged-apply'import { useStagedChangesStore } from '../../stores/stagedChangesStore'+import { useAgentModeStore } from '../../stores/agentModeStore'const fsWrite = backendCall as unknown as ReturnType<typeof vi.fn>const CHAT = 'chat-1'+// The run pins the chat's workspace slug on first use and passes it as the+// bridge's `chatId` on every tool call; apply has to write through the same+// name, never the raw conversation id.+const SLUG = 'coding-agent-chat-1'const stage = (path: string, over: Record<string, unknown> = {}) =>useStagedChangesStore.getState().stage(CHAT, {@@ -33,6 +38,27 @@ describe('applyStagedChange', () => {fsWrite.mockReset()addMessage.mockClear()useStagedChangesStore.getState().clear(CHAT)+ useAgentModeStore.setState({ workspaceSlugs: { [CHAT]: SLUG } })+ })++ // t10 on the box (2026-09-06): with no folder picked, "Apply all" wrote into+ // agent-workspace/<conversation id> while the run had worked in+ // agent-workspace/<slug>, so the model found nothing where it had put it+ // and wrote the files a second time by shell.+ it('writes into the sandbox the run used (the workspace slug), not the raw conversation id', async () => {+ fsWrite.mockResolvedValue({ status: 'saved', path: 'NOTES.md' })+ stage('NOTES.md')+ await applyStagedChange(CHAT, useStagedChangesStore.getState().list(CHAT)[0])++ expect(fsWrite).toHaveBeenCalledWith('fs_write', {+ path: 'NOTES.md',+ content: 'content of NOTES.md',+ chatId: SLUG,+ workingDirectory: undefined,+ })+ const calls = fsWrite.mock.calls.filter(([cmd]) => cmd === 'fs_read' || cmd === 'fs_write')+ expect(calls.every(([, args]) => (args as { chatId: string }).chatId === SLUG)).toBe(true)+ expect(calls.some(([, args]) => (args as { chatId: string }).chatId === CHAT)).toBe(false)})it('writes via fs_write with the stage-time jail root and dequeues the entry', async () => {@@ -45,7 +71,7 @@ describe('applyStagedChange', () => {expect(fsWrite).toHaveBeenCalledWith('fs_write', {path: '/proj/gui.py',content: 'content of gui.py',- chatId: CHAT,+ chatId: SLUG,workingDirectory: '/proj',})expect(useStagedChangesStore.getState().list(CHAT)).toHaveLength(0)@@ -186,7 +212,7 @@ describe('applyStagedChange refuses to overwrite a file that moved on', () => {expect(fsWrite).toHaveBeenCalledWith('fs_write', {path: '/proj/a.py',content: 'a\nCHANGED\nc\nadded by another tool',- chatId: CHAT,+ chatId: SLUG,workingDirectory: '/proj',})expect(useStagedChangesStore.getState().list(CHAT)).toHaveLength(0)diff --git a/src/lib/codex-mode.ts b/src/lib/codex-mode.tsindex 4e5b9673..9705015d 100644--- a/src/lib/codex-mode.ts+++ b/src/lib/codex-mode.ts@@ -44,7 +44,7 @@ export const CODEX_MODE_SHORT: Record<CodexMode, string> = {export const CODEX_MODE_DESCRIPTIONS: Record<CodexMode, string> = {ask: 'Confirm commands, review edits before they land',- bypass: 'Run without asking. Cloud shell still confirms',+ bypass: 'Run without asking. Commands and edits land as they come',plan: 'Read only. Writes a plan, then waits for approval',}diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.tsindex fa6a82c9..963ae47e 100644--- a/src/lib/release-notes.ts+++ b/src/lib/release-notes.ts@@ -66,6 +66,7 @@ export const RELEASE_NOTES: ReleaseNote[] = ['German phrasing reaches the chat tools. Plain chat offers its tools only when it recognises what you asked for, and its German half misread two common cases. The filler word "mal", which turns up in most casual German sentences, was read as the command to paint, so ordinary questions were sent to image generation. And no German word for the internet was on any list, so a request like "schau im Netz nach" matched nothing and the model answered from memory instead of looking anything up. Both are fixed, along with two smaller gaps in the German verb lists.','When a provider goes away and the model you had chosen goes with it, the app falls back to the first entry it finds and says so in the status line above the message field, instead of switching in silence. A click on a model that is still loading says what it is waiting for.','Updates no longer leave the previous frontend behind. On a machine that has been updating since April this frees around 130 MB and a thousand files.',+ 'Approve and run in Ask mode no longer looks stuck at the first command. Two staged files could fill the whole coding column, the transcript below shrank to nothing and the approval card of the next step sat behind the message field where no scroll reached it, so the run waited on your ok that you could not give. The Pending list now scrolls inside a cap, the transcript keeps its height, and the card scrolls into view the moment it appears. Apply all also writes into the folder the run worked in, not a second folder named after the conversation, so the model finds the files it staged. The Bypass entry in the mode menu no longer promises a cloud confirm that is off unless you switch it on. Reported in the Discord help chat.',],},{diff --git a/src/lib/staged-apply.ts b/src/lib/staged-apply.tsindex ccecdd57..b394ab32 100644--- a/src/lib/staged-apply.ts+++ b/src/lib/staged-apply.ts@@ -16,6 +16,7 @@import { backendCall } from '../api/backend'import { useStagedChangesStore, type StagedChange } from '../stores/stagedChangesStore'import { useChatStore } from '../stores/chatStore'+import { resolveChatWorkspaceSlug } from '../api/workspace-slug'import { mergeThreeWay } from './three-way-merge'/**@@ -75,7 +76,7 @@ const withEol = (text: string, eol: '\r\n' | '\n') =>* genuinely is not there still throws on the read and takes the create path.*/async function reconcile(- chatId: string,+ jail: string,change: StagedChange,): Promise<{ content: string; merged: number }> {const base = change.oldContent ?? ''@@ -83,7 +84,7 @@ async function reconcile(try {const res = await backendCall<{ content?: string }>('fs_read', {path: change.resolvedPath || change.path,- chatId,+ chatId: jail,workingDirectory: change.workingDirectory,})current = res?.content ?? ''@@ -108,12 +109,28 @@ async function reconcile()}+/**+ * The sandbox the bridge falls back to when no folder is picked is keyed by+ * the chat's WORKSPACE SLUG (`resolveChatWorkspaceSlug`), which is what the+ * run passes as `chatId` on every tool call. Apply used to pass the raw+ * conversation id instead, so with no folder picked "Apply all" wrote into+ * `agent-workspace/<conversation id>` while the run had read, listed and+ * executed in `agent-workspace/<slug>`: the model then found nothing where it+ * had put it and wrote the files a second time by shell (t10 measurement on+ * the box, 2026-09-06). Same resolver, same pin, same folder.+ */+async function jailFor(chatId: string): Promise<string> {+ const title = useChatStore.getState().conversations?.find((c) => c.id === chatId)?.title+ return resolveChatWorkspaceSlug(chatId, title)+}+export async function applyStagedChange(chatId: string, change: StagedChange): Promise<void> {- const { content, merged } = await reconcile(chatId, change)+ const jail = await jailFor(chatId)+ const { content, merged } = await reconcile(jail, change)const res = await backendCall<{ status?: string; path?: string }>('fs_write', {path: change.resolvedPath || change.path,content,- chatId,+ chatId: jail,workingDirectory: change.workingDirectory,})// 'saved' and 'unchanged' are both success ('unchanged' = the file already