From 26e21251d037bc69e38343092df9e7352ed26ea9 Mon Sep 17 00:00:00 2001 From: iliya Date: Mon, 23 Mar 2026 13:16:30 +0200 Subject: [PATCH] fix(tasks): prevent duplicate task comments by adding stable comment ID - Introduced a stable comment ID format to ensure that comments are not duplicated when the completeTask function is called multiple times for the same task. - Updated the addTaskComment function to include the new ID format, which combines the completedTask ID and blockedTask ID. This change enhances the task management system by improving comment handling during task resolution. --- agent-teams-controller/src/internal/tasks.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent-teams-controller/src/internal/tasks.js b/agent-teams-controller/src/internal/tasks.js index bf561290..9f298e5a 100644 --- a/agent-teams-controller/src/internal/tasks.js +++ b/agent-teams-controller/src/internal/tasks.js @@ -278,7 +278,11 @@ function notifyUnblockedOwners(context, completedTask) { ); } + // Stable comment ID prevents duplicates when completeTask is called + // multiple times for the same task (e.g. agent retry). addTaskComment + // in taskStore.js deduplicates by id (line 485). addTaskComment(context, blockedTask.id, { + id: `dep-resolved-${completedTask.id}-${blockedTask.id}`, text: lines.join('\n'), from: 'system', });