Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export function ReviewQueue() {

useEffect(() => {
loadAgents();
const interval = setInterval(loadAgents, 30_000);
return () => clearInterval(interval);
}, [loadAgents]);

const handleApprove = useCallback(
Expand Down
Loading