| ... | ... | @@ -6,7 +6,6 @@ import { AnchoredToastProvider, ToastProvider } from "../components/ui/toast"; |
| 6 | 6 | import { isElectron } from "../env"; |
| 7 | 7 | import { useNativeApi } from "../hooks/useNativeApi"; |
| 8 | 8 | import { invalidateGitQueries } from "../lib/gitReactQuery"; |
| 9 | | import { providerQueryKeys } from "../lib/providerReactQuery"; |
| 10 | 9 | import { DEFAULT_MODEL } from "../model-logic"; |
| 11 | 10 | import { useStore } from "../store"; |
| 12 | 11 | import { onServerWelcome } from "../wsNativeApi"; |
| ... | ... | @@ -59,7 +58,15 @@ function EventRouter() { |
| 59 | 58 | void invalidateGitQueries(queryClient); |
| 60 | 59 | } |
| 61 | 60 | if (event.method === "checkpoint/captured") { |
| 62 | | void queryClient.invalidateQueries({ queryKey: providerQueryKeys.all }); |
| 61 | const payload = event.payload as { turnCount?: number } | undefined; |
| 62 | const turnCount = payload?.turnCount; |
| 63 | void queryClient.invalidateQueries({ |
| 64 | queryKey: ["providers", "checkpointDiff"] as const, |
| 65 | predicate: (query) => { |
| 66 | if (typeof turnCount !== "number") return true; |
| 67 | return query.queryKey[5] === turnCount; |
| 68 | }, |
| 69 | }); |
| 63 | 70 | } |
| 64 | 71 | if (!activeThreadId) return; |
| 65 | 72 | dispatch({ |