From ca26875ea3f3aadfa2b678886ca915cb151b5566 Mon Sep 17 00:00:00 2001 From: Wesley Tanner <137104411+fireball71@users.noreply.github.com> Date: Fri, 30 Oct 2026 07:14:45 -0500 Subject: [PATCH] fix(frontend): invalidate provider caches on remote resync --- frontend/src/contexts/EventContext.test.tsx | 1 + frontend/src/contexts/EventContext.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/contexts/EventContext.test.tsx b/frontend/src/contexts/EventContext.test.tsx index a409dd4e..6aa08a2f 100644 --- a/frontend/src/contexts/EventContext.test.tsx +++ b/frontend/src/contexts/EventContext.test.tsx @@ -3027,6 +3027,7 @@ describe('EventProvider permissions and forms', () => { await waitFor(() => { expect(invalidateQueries).toHaveBeenCalledWith({ queryKey: ['opencode', 'commands', 'srv_remote'] }) expect(invalidateQueries).toHaveBeenCalledWith({ queryKey: ['opencode', 'agents', 'srv_remote'] }) + expect(invalidateQueries).toHaveBeenCalledWith({ queryKey: ['provider-integrations'] }) }) expect(invalidateQueries).not.toHaveBeenCalledWith({ queryKey: ['opencode', 'commands'] }) }) diff --git a/frontend/src/contexts/EventContext.tsx b/frontend/src/contexts/EventContext.tsx index f997b51e..e05a53fc 100644 --- a/frontend/src/contexts/EventContext.tsx +++ b/frontend/src/contexts/EventContext.tsx @@ -1252,6 +1252,7 @@ export function EventProvider({ children }: { children: React.ReactNode }) { const handleResync = (subscribedDirectories: string[], serverId?: string) => { queryClient.invalidateQueries({ queryKey: [SESSION_GOAL_QUERY_ROOT] }) + invalidateProviderCachesDebounced(queryClient) if (serverId && !isLocalOpenCodeServer(serverId)) { void reconcileRemoteDirectoryActivity(serverId, subscribedDirectories) invalidateSessionListCachesDebounced(queryClient, undefined, serverId) @@ -1267,7 +1268,6 @@ export function EventProvider({ children }: { children: React.ReactNode }) { void syncRunningShells(directories) invalidateChildSessionCaches(queryClient) invalidateQueryKeysDebounced(queryClient, LOCATION_CATALOG_QUERY_KEYS) - invalidateProviderCachesDebounced(queryClient) } const initialDirectories = [...new Set((reposRef.current ?? []).map(r => r.fullPath))]