From 42a3fd56dd089239cb34c65143a1192f2c83a664 Mon Sep 17 00:00:00 2001 From: Raghuram Banda Date: Thu, 21 May 2026 12:01:25 -0400 Subject: [PATCH] feat: add polling refresh to ReviewQueue and OpsOverview Both ReviewQueue and OpsOverview now poll every 30 seconds for fresh agent data, so new review submissions appear without requiring manual page navigation. Previously these components only fetched data once on mount, meaning admins had to navigate away and back to see newly submitted agents. Part of Epic #3208 --- .../components/CommandCenter/OpsOverview.tsx | 39 +++++++++++-------- .../components/CommandCenter/ReviewQueue.tsx | 2 + 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/workspaces/augment/plugins/augment/src/components/CommandCenter/OpsOverview.tsx b/workspaces/augment/plugins/augment/src/components/CommandCenter/OpsOverview.tsx index e0c7faf565..c8fbdfaa77 100644 --- a/workspaces/augment/plugins/augment/src/components/CommandCenter/OpsOverview.tsx +++ b/workspaces/augment/plugins/augment/src/components/CommandCenter/OpsOverview.tsx @@ -56,25 +56,30 @@ export function OpsOverview({ namespace, onNavigate }: OpsOverviewProps) { useEffect(() => { let cancelled = false; - setLoading(true); - Promise.all([ - api.listAgents().catch(() => []), - api - .listKagentiTools(namespace) - .then(r => r.tools ?? []) - .catch(() => []), - ]) - .then(([a, t]) => { - if (!cancelled) { - setAgents(a as ChatAgent[]); - setTools(t); - } - }) - .finally(() => { - if (!cancelled) setLoading(false); - }); + const load = () => { + setLoading(true); + Promise.all([ + api.listAgents().catch(() => []), + api + .listKagentiTools(namespace) + .then(r => r.tools ?? []) + .catch(() => []), + ]) + .then(([a, t]) => { + if (!cancelled) { + setAgents(a as ChatAgent[]); + setTools(t); + } + }) + .finally(() => { + if (!cancelled) setLoading(false); + }); + }; + load(); + const interval = setInterval(load, 30_000); return () => { cancelled = true; + clearInterval(interval); }; }, [api, namespace]); diff --git a/workspaces/augment/plugins/augment/src/components/CommandCenter/ReviewQueue.tsx b/workspaces/augment/plugins/augment/src/components/CommandCenter/ReviewQueue.tsx index 18307a0a95..b90542877e 100644 --- a/workspaces/augment/plugins/augment/src/components/CommandCenter/ReviewQueue.tsx +++ b/workspaces/augment/plugins/augment/src/components/CommandCenter/ReviewQueue.tsx @@ -59,6 +59,8 @@ export function ReviewQueue() { useEffect(() => { loadAgents(); + const interval = setInterval(loadAgents, 30_000); + return () => clearInterval(interval); }, [loadAgents]); const handleApprove = useCallback(