From 04e32ab4cc67239bed54c07b3bb79f47dcf11d50 Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Wed, 3 Sep 2025 15:41:59 +0800 Subject: [PATCH 1/2] fix: duplicated task shown in frontend --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- package.json | 2 +- src/store/chatStore.ts | 35 ++++++++++++++++----------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d7da19938..9cff33234 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -12,7 +12,7 @@ body: id: version attributes: label: What version of eigent are you using? - placeholder: E.g., 0.0.63 + placeholder: E.g., 0.0.64 validations: required: true diff --git a/package.json b/package.json index 0192255dc..17ca6ebc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eigent", - "version": "0.0.63", + "version": "0.0.64", "main": "dist-electron/main/index.js", "description": "Eigent", "author": "Eigent.AI", diff --git a/src/store/chatStore.ts b/src/store/chatStore.ts index f5c5eb91a..7069fa406 100644 --- a/src/store/chatStore.ts +++ b/src/store/chatStore.ts @@ -605,23 +605,29 @@ const chatStore = create()( // The following logic is for when the task actually starts executing (running) if (taskAssigning && taskAssigning[assigneeAgentIndex]) { - // const exist = taskAssigning[assigneeAgentIndex].tasks.find(item => item.id === task_id); - let taskTemp = null - if (task) { - taskTemp = JSON.parse(JSON.stringify(task)) - taskTemp.failure_count = 0 - taskTemp.status = "running" - taskTemp.toolkits = [] - taskTemp.report = "" + // Check if task already exists in the agent's task list + const existingTaskIndex = taskAssigning[assigneeAgentIndex].tasks.findIndex(item => item.id === task_id); + + if (existingTaskIndex !== -1) { + // Task already exists, update its status + taskAssigning[assigneeAgentIndex].tasks[existingTaskIndex].status = "running"; + } else { + // Task doesn't exist, add it + let taskTemp = null + if (task) { + taskTemp = JSON.parse(JSON.stringify(task)) + taskTemp.failure_count = 0 + taskTemp.status = "running" + taskTemp.toolkits = [] + taskTemp.report = "" + } + taskAssigning[assigneeAgentIndex].tasks.push(taskTemp ?? { id: task_id, content, status: "running", }); } - taskAssigning[assigneeAgentIndex].tasks.push(taskTemp ?? { id: task_id, content, status: "running", }); - // if (exist) { - // exist.status = "running"; - // } else { - // taskAssigning[assigneeAgentIndex].tasks.push(taskTemp ?? { id: task_id, content, status: "running", }); - // } } + + // Only update or add to taskRunning, never duplicate if (taskRunningIndex === -1) { + // Task not in taskRunning, add it taskRunning!.push( task ?? { id: task_id, @@ -631,6 +637,7 @@ const chatStore = create()( } ); } else { + // Task already in taskRunning, update it taskRunning![taskRunningIndex] = { ...taskRunning![taskRunningIndex], content, From 00665d9691cd83cd62f7bf6d4c35468801e7437f Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Wed, 3 Sep 2025 16:14:04 +0800 Subject: [PATCH 2/2] release: 0065 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9cff33234..15156ba82 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -12,7 +12,7 @@ body: id: version attributes: label: What version of eigent are you using? - placeholder: E.g., 0.0.64 + placeholder: E.g., 0.0.65 validations: required: true diff --git a/package.json b/package.json index 17ca6ebc4..3cc601a59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eigent", - "version": "0.0.64", + "version": "0.0.65", "main": "dist-electron/main/index.js", "description": "Eigent", "author": "Eigent.AI",