@@ -388,7 +388,10 @@ export class Asana extends Tool<Asana> implements ProjectTool {
388388 description = task . notes ;
389389 }
390390
391- // Construct Asana task URL
391+ // Use stable identifier for source
392+ const activitySource = `asana:task:${ task . gid } ` ;
393+
394+ // Construct Asana task URL for link
392395 const taskUrl = `https://app.asana.com/0/${ projectId } /${ task . gid } ` ;
393396
394397 // Create initial note with description and link to Asana task
@@ -400,15 +403,15 @@ export class Asana extends Tool<Asana> implements ProjectTool {
400403 } ) ;
401404
402405 notes . push ( {
403- activity : { source : taskUrl } ,
406+ activity : { source : activitySource } ,
404407 key : "description" ,
405408 content : description ,
406409 created : task . created_at ? new Date ( task . created_at ) : undefined ,
407410 links : links . length > 0 ? links : null ,
408411 } ) ;
409412
410413 return {
411- source : taskUrl ,
414+ source : activitySource ,
412415 type : ActivityType . Action ,
413416 title : task . name ,
414417 created : task . created_at ? new Date ( task . created_at ) : undefined ,
@@ -647,8 +650,8 @@ export class Asana extends Tool<Asana> implements ProjectTool {
647650 } ;
648651 }
649652
650- // Construct task URL
651- const taskUrl = `https://app. asana.com/0/ ${ projectId } / ${ task . gid } ` ;
653+ // Use stable identifier for source
654+ const activitySource = `asana:task: ${ task . gid } ` ;
652655
653656 // Extract description
654657 let description : string | null = null ;
@@ -658,7 +661,7 @@ export class Asana extends Tool<Asana> implements ProjectTool {
658661
659662 // Create partial activity update (no notes = doesn't touch existing notes)
660663 const activity : NewActivity = {
661- source : taskUrl ,
664+ source : activitySource ,
662665 type : ActivityType . Action ,
663666 title : task . name ,
664667 created : task . created_at ? new Date ( task . created_at ) : undefined ,
@@ -695,8 +698,8 @@ export class Asana extends Tool<Asana> implements ProjectTool {
695698 const taskGid = event . resource . gid ;
696699
697700 try {
698- // Construct task URL
699- const taskUrl = `https://app. asana.com/0/ ${ projectId } / ${ taskGid } ` ;
701+ // Use stable identifier for source
702+ const activitySource = `asana:task: ${ taskGid } ` ;
700703
701704 // Fetch stories (comments) for this task
702705 // We fetch all stories since Asana doesn't provide the specific story GID in the webhook
@@ -733,19 +736,23 @@ export class Asana extends Tool<Asana> implements ProjectTool {
733736
734737 // Create activity update with single story note
735738 const activity : NewActivityWithNotes = {
736- source : taskUrl ,
739+ source : activitySource ,
737740 type : ActivityType . Action , // Required field (will match existing activity)
738741 notes : [
739742 {
740743 key : `story-${ latestStory . gid } ` ,
741- activity : { source : taskUrl } ,
744+ activity : { source : activitySource } ,
742745 content : latestStory . text || "" ,
743746 created : latestStory . created_at
744747 ? new Date ( latestStory . created_at )
745748 : undefined ,
746749 author : storyAuthor ,
747750 } as NewNote ,
748751 ] ,
752+ meta : {
753+ taskGid,
754+ projectId,
755+ } ,
749756 } ;
750757
751758 await this . tools . callbacks . run ( callbackToken , activity ) ;
0 commit comments