From 3aa99144d457fe6f4230dca8a1d09c9781e079e2 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 12 Feb 2026 16:08:21 -0600 Subject: [PATCH] Stop job polling on error (404) to prevent infinite poll loop When the poll request fails (e.g. job not found 404), clear the activeJob state and stop the interval instead of endlessly retrying. Also refresh the KB detail to get the current state. Co-Authored-By: Claude Opus 4.6 --- frontend/components/KnowledgeBase.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/components/KnowledgeBase.tsx b/frontend/components/KnowledgeBase.tsx index b6311a4..cbbcb29 100644 --- a/frontend/components/KnowledgeBase.tsx +++ b/frontend/components/KnowledgeBase.tsx @@ -128,6 +128,11 @@ export const KnowledgeBase: React.FC = () => { } } catch (err) { console.error('Failed to poll job:', err); + // Stop polling on error (e.g. 404 job not found) + setActiveJob(null); + if (pollRef.current) clearInterval(pollRef.current); + pollRef.current = null; + loadKbDetail(selectedKb.id); } }, 3000); }