From 334f82eaad79dad6819d5d5423a75eabf1d87010 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 8 Mar 2026 21:41:27 +0800 Subject: [PATCH] feat(app): sync backend config on app initialization - Call syncConfigStoreFromBackend() on app mount - Export __testables from smart-search for testing - Complements configStore refactoring --- ccw/frontend/src/App.tsx | 4 ++++ ccw/src/tools/smart-search.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ccw/frontend/src/App.tsx b/ccw/frontend/src/App.tsx index f0fd7f26..6fb8a508 100644 --- a/ccw/frontend/src/App.tsx +++ b/ccw/frontend/src/App.tsx @@ -17,6 +17,7 @@ import { useCliStreamStore } from '@/stores/cliStreamStore'; import { useCliSessionStore } from '@/stores/cliSessionStore'; import { useExecutionMonitorStore } from '@/stores/executionMonitorStore'; import { useSessionManagerStore } from '@/stores/sessionManagerStore'; +import { syncConfigStoreFromBackend } from '@/stores/configStore'; import { useIssueQueueIntegrationStore } from '@/stores/issueQueueIntegrationStore'; import { useQueueExecutionStore } from '@/stores/queueExecutionStore'; import { useQueueSchedulerStore } from '@/stores/queueSchedulerStore'; @@ -38,6 +39,9 @@ function App({ locale, messages }: AppProps) { // Initialize CSRF token on app mount useEffect(() => { initializeCsrfToken().catch(console.error); + syncConfigStoreFromBackend().catch(() => { + // syncConfigStoreFromBackend already logs the failure reason + }); }, []); return ( diff --git a/ccw/src/tools/smart-search.ts b/ccw/src/tools/smart-search.ts index df6b4cf5..b5e5d17c 100644 --- a/ccw/src/tools/smart-search.ts +++ b/ccw/src/tools/smart-search.ts @@ -3159,6 +3159,12 @@ export async function handler(params: Record): Promise, onProgress?: (progress: ProgressInfo) => void