fix(team): prevent task progress regression from model actions

This commit is contained in:
viettranx committed 2026-03-20 08:27:18 +07:00
1 parent 60995ff956
commit 89937edb22
1 file changed
+5
+5
View File
@@ -322,6 +322,11 @@ func (t *TeamTasksTool) executeProgress(ctx context.Context, args map[string]any
return ErrorResult("only the assigned task owner can update progress. As team lead, task results arrive automatically when members complete their work.")
}
// Prevent progress regression — keep the higher value.
if percent < task.ProgressPercent {
percent = task.ProgressPercent
}
if err := t.manager.teamStore.UpdateTaskProgress(ctx, taskID, team.ID, percent, step); err != nil {
return ErrorResult("failed to update progress: " + err.Error())
}