Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Fix broad query invalidation on checkpoint/captured events

Cursor Agent24c617d32ef6
diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx
index 866da47eb..bfac06dff 100644
--- a/apps/web/src/routes/__root.tsx
+++ b/apps/web/src/routes/__root.tsx
@@ -6,7 +6,6 @@ import { AnchoredToastProvider, ToastProvider } from "../components/ui/toast";
import { isElectron } from "../env";
import { useNativeApi } from "../hooks/useNativeApi";
import { invalidateGitQueries } from "../lib/gitReactQuery";
-import { providerQueryKeys } from "../lib/providerReactQuery";
import { DEFAULT_MODEL } from "../model-logic";
import { useStore } from "../store";
import { onServerWelcome } from "../wsNativeApi";
@@ -59,7 +58,15 @@ function EventRouter() {
void invalidateGitQueries(queryClient);
}
if (event.method === "checkpoint/captured") {
- void queryClient.invalidateQueries({ queryKey: providerQueryKeys.all });
+ const payload = event.payload as { turnCount?: number } | undefined;
+ const turnCount = payload?.turnCount;
+ void queryClient.invalidateQueries({
+ queryKey: ["providers", "checkpointDiff"] as const,
+ predicate: (query) => {
+ if (typeof turnCount !== "number") return true;
+ return query.queryKey[5] === turnCount;
+ },
+ });
}
if (!activeThreadId) return;
dispatch({