From daf6483758887740fff0eb92c76fb6d247f21c14 Mon Sep 17 00:00:00 2001 From: Jonathan Mieloo Date: Mon, 12 Jan 2026 10:15:57 +0100 Subject: [PATCH 1/2] Set mode to acceptEdits when 'Always allow' is selected --- .../sessions/components/SessionView.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/array/src/renderer/features/sessions/components/SessionView.tsx b/apps/array/src/renderer/features/sessions/components/SessionView.tsx index 298eecf2f..0e415cca1 100644 --- a/apps/array/src/renderer/features/sessions/components/SessionView.tsx +++ b/apps/array/src/renderer/features/sessions/components/SessionView.tsx @@ -159,6 +159,14 @@ export function SessionView({ async (optionId: string, customInput?: string) => { if (!firstPendingPermission || !taskId) return; + // Check if the selected option is "allow_always" and set mode to acceptEdits + const selectedOption = firstPendingPermission.options.find( + (o) => o.optionId === optionId, + ); + if (selectedOption?.kind === "allow_always" && !isCloud) { + setSessionMode(taskId, "acceptEdits"); + } + if (customInput) { // Check if this is an "other" option (AskUserQuestion) or plan feedback if (optionId === "other") { @@ -187,7 +195,14 @@ export function SessionView({ ); } }, - [firstPendingPermission, taskId, respondToPermission, onSendPrompt], + [ + firstPendingPermission, + taskId, + respondToPermission, + onSendPrompt, + isCloud, + setSessionMode, + ], ); const handlePermissionCancel = useCallback(async () => { From 7b75c31fb8085404bbd6fb5d742c760e0afe4012 Mon Sep 17 00:00:00 2001 From: Jonathan Mieloo Date: Mon, 12 Jan 2026 10:48:19 +0100 Subject: [PATCH 2/2] fix/try-fix-excessive-watcher-memory-usage --- .../src/main/services/file-watcher/service.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/array/src/main/services/file-watcher/service.ts b/apps/array/src/main/services/file-watcher/service.ts index 73df3ed2a..768e99c3c 100644 --- a/apps/array/src/main/services/file-watcher/service.ts +++ b/apps/array/src/main/services/file-watcher/service.ts @@ -14,8 +14,9 @@ import { const log = logger.scope("file-watcher"); -const IGNORE_PATTERNS = ["**/node_modules/**", "**/.git/**"]; -const DEBOUNCE_MS = 100; +const IGNORE_PATTERNS = ["**/node_modules/**", "**/.git/**", "**/.jj/**"]; +const DEBOUNCE_MS = 500; +const BULK_THRESHOLD = 100; interface PendingChanges { dirs: Set; @@ -177,6 +178,18 @@ export class FileWatcherService extends TypedEventEmitter { } private flushPending(repoPath: string, pending: PendingChanges): void { + const totalChanges = pending.files.size + pending.deletes.size; + + // For bulk changes, emit a single event instead of per-file events + if (totalChanges > BULK_THRESHOLD) { + this.emit(FileWatcherEvent.GitStateChanged, { repoPath }); + pending.dirs.clear(); + pending.files.clear(); + pending.deletes.clear(); + pending.timer = null; + return; + } + for (const dirPath of pending.dirs) { this.emit(FileWatcherEvent.DirectoryChanged, { repoPath, dirPath }); }