diff --git a/surfsense_web/atoms/model-connections/model-connections-query.atoms.ts b/surfsense_web/atoms/model-connections/model-connections-query.atoms.ts index f73fc3f18..b6c57af9e 100644 --- a/surfsense_web/atoms/model-connections/model-connections-query.atoms.ts +++ b/surfsense_web/atoms/model-connections/model-connections-query.atoms.ts @@ -54,6 +54,9 @@ export const llmSetupStatusAtomFamily = atomFamily((workspaceId: number) => queryKey: cacheKeys.modelConnections.setupStatus(workspaceId), enabled: workspaceId > 0 && isAuthenticated(), staleTime: 5 * 60 * 1000, + // Recovery is event-driven: mutations invalidate this key; external fixes + // are caught on window focus. No polling, so not-ready tabs cost nothing. + refetchOnWindowFocus: true, queryFn: () => modelConnectionsApiService.getLlmSetupStatus(workspaceId), })) );