From 9be9a91d133a0dd62facf981d5dadc9627212325 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Tue, 21 Jul 2026 14:41:48 -0500 Subject: [PATCH] fix(ui-tui): seed mcp_rev baseline at startup so first cosmetic write doesn't reload MCP (Bugbot r5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The startup config.get seeded mtimeRef but not mcpRevRef; after a normal boot mtime is already non-zero so the poller's baseline branch never runs, leaving mcpRevRef empty. The first /skin (or other cosmetic) write bumped mtime with an unchanged mcp_rev, and empty !== hash tripped a full reload.mcp — exactly the reconnect this optimization removes. Seed the revision alongside mtime at boot. --- ui-tui/src/app/useConfigSync.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui-tui/src/app/useConfigSync.ts b/ui-tui/src/app/useConfigSync.ts index af7eb8ab5ec0..f5f0a525f793 100644 --- a/ui-tui/src/app/useConfigSync.ts +++ b/ui-tui/src/app/useConfigSync.ts @@ -259,6 +259,11 @@ export function useConfigSync({ setVoiceEnabled(process.env.HERMES_VOICE === '1') quietRpc(gw, 'config.get', { key: 'mtime' }).then(r => { mtimeRef.current = Number(r?.mtime ?? 0) + // Seed the MCP revision baseline too: after a normal boot mtime is + // already non-zero, so the poller's baseline branch never runs, and an + // unset mcpRevRef would make the FIRST cosmetic write (mtime bump, same + // mcp_rev) look like an MCP change and fire a needless reload.mcp. + mcpRevRef.current = String(r?.mcp_rev ?? '') }) void hydrateFullConfig(gw, setBellOnComplete, setVoiceRecordKey) }, [gw, setBellOnComplete, setVoiceEnabled, setVoiceRecordKey, sid])