From 2068902645abe4f88c6be12170170bdcc51463de Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Mon, 6 Oct 2025 15:30:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Frontend=20Displays=20Empty=20Tasks=20?= =?UTF-8?q?=E2=80=93=20Investigation=20Needed=20issue=20436?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/utils/workforce.py | 6 +++++- src/store/chatStore.ts | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/app/utils/workforce.py b/backend/app/utils/workforce.py index f64a1e7c3..541110253 100644 --- a/backend/app/utils/workforce.py +++ b/backend/app/utils/workforce.py @@ -132,7 +132,11 @@ class Workforce(BaseWorkforce): continue # Find task content task_obj = get_camel_task(item.task_id, tasks) - content = task_obj.content if task_obj else "" + if task_obj is None: + logger.warning(f"[WF] WARN: Task {item.task_id} not found in tasks list during ASSIGN phase. This may indicate a task tree inconsistency.") + content = "" + else: + content = task_obj.content # Asynchronously send waiting notification task = asyncio.create_task( task_lock.put_queue( diff --git a/src/store/chatStore.ts b/src/store/chatStore.ts index 29d39a8ab..a63037833 100644 --- a/src/store/chatStore.ts +++ b/src/store/chatStore.ts @@ -589,6 +589,13 @@ const chatStore = create()( const taskRunningIndex = taskRunning!.findIndex((task: TaskInfo) => task.id === task_id); + // Skip tasks with empty content only if the task doesn't exist in taskInfo + // If task exists in taskInfo, we should still process status updates + if ((!content || content.trim() === "") && !task) { + console.warn(`Skipping task ${task_id} with empty content and not found in taskInfo`); + return; + } + if (assigneeAgentIndex === -1) return; const taskAgent = taskAssigning![assigneeAgentIndex];