From c4cfe5e893348c4ae78d6b3102d00d0c39d06254 Mon Sep 17 00:00:00 2001 From: dimakis Date: Fri, 22 May 2026 13:13:21 +0100 Subject: [PATCH] fix(ui): sync model preference into store on startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Zustand store initialized config.modelId as null while the UI dropdown read from localStorage. sendMessage() used the store value, so the model field was never sent — the SDK fell back to Sonnet. Co-Authored-By: Claude Opus 4.6 --- frontend/src/client-store.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/client-store.ts b/frontend/src/client-store.ts index 647e4413..4dcfaffd 100644 --- a/frontend/src/client-store.ts +++ b/frontend/src/client-store.ts @@ -13,6 +13,7 @@ import { registerCapacitorLifecycle } from './lib/capacitor'; import { configureKeyboard } from './lib/keyboard'; import { initPushNotifications } from './lib/push'; import { eventBus } from './lib/event-bus-singleton'; +import { getPreferredModel } from './lib/model-preference'; export const clientStore = createMitzoStore({ transport: { @@ -26,6 +27,9 @@ export const clientStore = createMitzoStore({ }, }); +// Sync localStorage model preference into the store so sendMessage() includes it +clientStore.getState().setModel(getPreferredModel()); + // Wire Capacitor app lifecycle → force WS reconnect on resume, send suspend on background registerCapacitorLifecycle( () => {