From cf0f514d2504142d2c50efc11d8f1d31c2056607 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Sun, 29 Mar 2026 09:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=8A=B6=E6=80=81=E6=A0=8F?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96task=E8=B6=85=E6=97=B6=E8=AE=BE?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/use-connection-lifecycle.ts | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/hooks/use-connection-lifecycle.ts b/src/hooks/use-connection-lifecycle.ts index 2459889..a0742f9 100644 --- a/src/hooks/use-connection-lifecycle.ts +++ b/src/hooks/use-connection-lifecycle.ts @@ -70,10 +70,6 @@ export function useConnectionLifecycle({ const hasSelectorsData = modes !== null || configOptions !== null const effectiveSelectorsReady = selectorsReady || hasSelectorsData const selectorTaskIdRef = useRef(null) - const selectorTaskTimeoutRef = useRef | null>( - null - ) - const selectorTaskSuppressedRef = useRef(false) // Visual-only loading indicators for selector chips. // Skip loading indicators when we have cached selectors — even if the // cache contains no modes/configOptions (the agent simply doesn't have @@ -208,10 +204,6 @@ export function useConnectionLifecycle({ }, [status, addTask, updateTask, removeTask, agentType, t]) const clearSelectorTask = useCallback(() => { - if (selectorTaskTimeoutRef.current) { - clearTimeout(selectorTaskTimeoutRef.current) - selectorTaskTimeoutRef.current = null - } if (selectorTaskIdRef.current) { removeTask(selectorTaskIdRef.current) selectorTaskIdRef.current = null @@ -221,19 +213,10 @@ export function useConnectionLifecycle({ useEffect(() => { const isInteractive = status === "connected" || status === "prompting" if (!isInteractive) { - selectorTaskSuppressedRef.current = false clearSelectorTask() return } - if (selectorTaskSuppressedRef.current) { - clearSelectorTask() - return - } - - // Use the real backend selectorsReady (not effectiveSelectorsReady - // which includes cache) so the task shows during session creation - // even when cached selectors are available. if (selectorsReady) { clearSelectorTask() return @@ -250,14 +233,6 @@ export function useConnectionLifecycle({ ) updateTask(id, { status: "running" }) } - - if (!selectorTaskTimeoutRef.current) { - selectorTaskTimeoutRef.current = setTimeout(() => { - selectorTaskTimeoutRef.current = null - selectorTaskSuppressedRef.current = true - clearSelectorTask() - }, 5000) - } }, [ status, selectorsReady, @@ -288,7 +263,6 @@ export function useConnectionLifecycle({ if (taskIdRef.current) { removeTask(taskIdRef.current) } - selectorTaskSuppressedRef.current = false clearSelectorTask() } }, [removeTask, clearSelectorTask])