@@ -490,26 +490,22 @@ export class Cline {
490490 ] )
491491 }
492492
493- async resumePausedTask ( ) {
493+ async resumePausedTask ( lastMessage ?: string ) {
494494 // release this Cline instance from paused state
495495 this . isPaused = false
496496
497- // Clear any existing ask state and simulate a completed ask response
498- // this.askResponse = "messageResponse";
499- // this.askResponseText = "Sub Task finished Successfully!\nthere is no need to perform this task again, please continue to the next task.";
500- // this.askResponseImages = undefined;
501- // this.lastMessageTs = Date.now();
502-
503497 // This adds the completion message to conversation history
504- await this . say (
505- "text" ,
506- "Sub Task finished Successfully!\nthere is no need to perform this task again, please continue to the next task." ,
507- )
508-
509- // this.userMessageContent.push({
510- // type: "text",
511- // text: `${"Result:\\n\\nSub Task finished Successfully!\nthere is no need to perform this task again, please continue to the next task."}`,
512- // })
498+ await this . say ( "text" , `new_task finished successfully! ${ lastMessage ?? "Please continue to the next task." } ` )
499+
500+ await this . addToApiConversationHistory ( {
501+ role : "assistant" ,
502+ content : [
503+ {
504+ type : "text" ,
505+ text : `new_task finished successfully! ${ lastMessage ?? "Please continue to the next task." } ` ,
506+ } ,
507+ ] ,
508+ } )
513509
514510 try {
515511 // Resume parent task
@@ -2699,7 +2695,7 @@ export class Cline {
26992695 await this . say ( "completion_result" , result , undefined , false )
27002696 if ( this . isSubTask ) {
27012697 // tell the provider to remove the current subtask and resume the previous task in the stack
2702- this . providerRef . deref ( ) ?. finishSubTask ( )
2698+ this . providerRef . deref ( ) ?. finishSubTask ( lastMessage ?. text )
27032699 }
27042700 }
27052701
@@ -2720,7 +2716,7 @@ export class Cline {
27202716 await this . say ( "completion_result" , result , undefined , false )
27212717 if ( this . isSubTask ) {
27222718 // tell the provider to remove the current subtask and resume the previous task in the stack
2723- this . providerRef . deref ( ) ?. finishSubTask ( )
2719+ this . providerRef . deref ( ) ?. finishSubTask ( lastMessage ?. text )
27242720 }
27252721 }
27262722
0 commit comments