feat(app): sync backend config on app initialization

- Call syncConfigStoreFromBackend() on app mount
- Export __testables from smart-search for testing
- Complements configStore refactoring
This commit is contained in:
catlog22
2026-03-08 21:41:27 +08:00
parent 1c1a4afd23
commit 334f82eaad
2 changed files with 10 additions and 0 deletions

View File

@@ -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 (

View File

@@ -3159,6 +3159,12 @@ export async function handler(params: Record<string, unknown>): Promise<ToolResu
* @param params - Search parameters (path, languages, force)
* @param onProgress - Optional callback for progress updates
*/
export const __testables = {
parseCodexLensJsonOutput,
parsePlainTextFileMatches,
hasCentralizedVectorArtifacts,
};
export async function executeInitWithProgress(
params: Record<string, unknown>,
onProgress?: (progress: ProgressInfo) => void