去掉状态栏初始化task超时设定
This commit is contained in:
@@ -70,10 +70,6 @@ export function useConnectionLifecycle({
|
|||||||
const hasSelectorsData = modes !== null || configOptions !== null
|
const hasSelectorsData = modes !== null || configOptions !== null
|
||||||
const effectiveSelectorsReady = selectorsReady || hasSelectorsData
|
const effectiveSelectorsReady = selectorsReady || hasSelectorsData
|
||||||
const selectorTaskIdRef = useRef<string | null>(null)
|
const selectorTaskIdRef = useRef<string | null>(null)
|
||||||
const selectorTaskTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(
|
|
||||||
null
|
|
||||||
)
|
|
||||||
const selectorTaskSuppressedRef = useRef(false)
|
|
||||||
// Visual-only loading indicators for selector chips.
|
// Visual-only loading indicators for selector chips.
|
||||||
// Skip loading indicators when we have cached selectors — even if the
|
// Skip loading indicators when we have cached selectors — even if the
|
||||||
// cache contains no modes/configOptions (the agent simply doesn't have
|
// cache contains no modes/configOptions (the agent simply doesn't have
|
||||||
@@ -208,10 +204,6 @@ export function useConnectionLifecycle({
|
|||||||
}, [status, addTask, updateTask, removeTask, agentType, t])
|
}, [status, addTask, updateTask, removeTask, agentType, t])
|
||||||
|
|
||||||
const clearSelectorTask = useCallback(() => {
|
const clearSelectorTask = useCallback(() => {
|
||||||
if (selectorTaskTimeoutRef.current) {
|
|
||||||
clearTimeout(selectorTaskTimeoutRef.current)
|
|
||||||
selectorTaskTimeoutRef.current = null
|
|
||||||
}
|
|
||||||
if (selectorTaskIdRef.current) {
|
if (selectorTaskIdRef.current) {
|
||||||
removeTask(selectorTaskIdRef.current)
|
removeTask(selectorTaskIdRef.current)
|
||||||
selectorTaskIdRef.current = null
|
selectorTaskIdRef.current = null
|
||||||
@@ -221,19 +213,10 @@ export function useConnectionLifecycle({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const isInteractive = status === "connected" || status === "prompting"
|
const isInteractive = status === "connected" || status === "prompting"
|
||||||
if (!isInteractive) {
|
if (!isInteractive) {
|
||||||
selectorTaskSuppressedRef.current = false
|
|
||||||
clearSelectorTask()
|
clearSelectorTask()
|
||||||
return
|
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) {
|
if (selectorsReady) {
|
||||||
clearSelectorTask()
|
clearSelectorTask()
|
||||||
return
|
return
|
||||||
@@ -250,14 +233,6 @@ export function useConnectionLifecycle({
|
|||||||
)
|
)
|
||||||
updateTask(id, { status: "running" })
|
updateTask(id, { status: "running" })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!selectorTaskTimeoutRef.current) {
|
|
||||||
selectorTaskTimeoutRef.current = setTimeout(() => {
|
|
||||||
selectorTaskTimeoutRef.current = null
|
|
||||||
selectorTaskSuppressedRef.current = true
|
|
||||||
clearSelectorTask()
|
|
||||||
}, 5000)
|
|
||||||
}
|
|
||||||
}, [
|
}, [
|
||||||
status,
|
status,
|
||||||
selectorsReady,
|
selectorsReady,
|
||||||
@@ -288,7 +263,6 @@ export function useConnectionLifecycle({
|
|||||||
if (taskIdRef.current) {
|
if (taskIdRef.current) {
|
||||||
removeTask(taskIdRef.current)
|
removeTask(taskIdRef.current)
|
||||||
}
|
}
|
||||||
selectorTaskSuppressedRef.current = false
|
|
||||||
clearSelectorTask()
|
clearSelectorTask()
|
||||||
}
|
}
|
||||||
}, [removeTask, clearSelectorTask])
|
}, [removeTask, clearSelectorTask])
|
||||||
|
|||||||
Reference in New Issue
Block a user