From 904534adb353bcf0c48195b139720c670ba9a290 Mon Sep 17 00:00:00 2001 From: siddseethepalli Date: Sun, 8 Feb 2026 23:00:52 +0000 Subject: [PATCH] Clear existing suppress timer before creating new one in handleModelSet Rapid successive handleModelSet calls would overwrite the __suppress_reset__ timer in the map without cancelling the previous one. The orphaned timer would fire early, resetting suppressConfigReload to false before the latest write's file watcher event arrives, causing unexpected config reloads and session eviction. Co-Authored-By: Claude Opus 4.6 --- assistant/src/daemon/server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assistant/src/daemon/server.ts b/assistant/src/daemon/server.ts index c6bc5fd1ecb..c27e64cd011 100644 --- a/assistant/src/daemon/server.ts +++ b/assistant/src/daemon/server.ts @@ -373,6 +373,8 @@ export class DaemonServer { this.suppressConfigReload = false; throw err; } + const existingSuppressTimer = this.debounceTimers.get('__suppress_reset__'); + if (existingSuppressTimer) clearTimeout(existingSuppressTimer); const resetTimer = setTimeout(() => { this.suppressConfigReload = false; }, 300); this.debounceTimers.set('__suppress_reset__', resetTimer);