File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1167,6 +1167,11 @@ If your work needs human review before it can proceed: mc_report(status: "needs_
11671167 return ;
11681168 }
11691169
1170+ // Unsubscribe from monitor events BEFORE killing jobs to prevent
1171+ // completion/failure handlers from racing with plan cleanup.
1172+ this . unsubscribeFromMonitorEvents ( ) ;
1173+ this . activePlanId = null ;
1174+
11701175 const runningJobs = ( await getRunningJobs ( ) ) . filter ( ( job ) => job . planId === plan . id ) ;
11711176 for ( const job of runningJobs ) {
11721177 try {
@@ -1187,7 +1192,6 @@ If your work needs human review before it can proceed: mc_report(status: "needs_
11871192
11881193 await deleteIntegrationBranch ( plan . id ) ;
11891194 await clearPlan ( ) ;
1190- this . unsubscribeFromMonitorEvents ( ) ;
11911195 }
11921196
11931197 async skipJob ( jobName : string , reason ?: string ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments