diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d7da19938..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.63 + placeholder: E.g., 0.0.65 validations: required: true diff --git a/package.json b/package.json index 0192255dc..3cc601a59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eigent", - "version": "0.0.63", + "version": "0.0.65", "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,