You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// tell the provider to remove the current subtask and resume the previous task in the stack
2723
+
this.providerRef.deref()?.finishSubTask()
2724
+
}
2668
2725
}
2669
2726
2670
2727
// we already sent completion_result says, an empty string asks relinquishes control over button and field
@@ -2740,6 +2797,20 @@ export class Cline {
2740
2797
}
2741
2798
}
2742
2799
2800
+
// this function checks if this Cline instance is set to pause state and wait for being resumed,
2801
+
// this is used when a sub-task is launched and the parent task is waiting for it to finish
2802
+
asyncwaitForResume(){
2803
+
// wait until isPaused is false
2804
+
awaitnewPromise<void>((resolve)=>{
2805
+
constinterval=setInterval(()=>{
2806
+
if(!this.isPaused){
2807
+
clearInterval(interval)
2808
+
resolve()
2809
+
}
2810
+
},1000)// TBD: the 1 sec should be added to the settings, also should add a timeout to prevent infinit wait
2811
+
})
2812
+
}
2813
+
2743
2814
asyncrecursivelyMakeClineRequests(
2744
2815
userContent: UserContent,
2745
2816
includeFileDetails: boolean=false,
@@ -2779,6 +2850,12 @@ export class Cline {
2779
2850
awaitthis.checkpointSave({isFirst: true})
2780
2851
}
2781
2852
2853
+
// in this Cline request loop, we need to check if this cline (Task) instance has been asked to wait
2854
+
// for a sub-task (it has launched) to finish before continuing
2855
+
if(this.isPaused){
2856
+
awaitthis.waitForResume()
2857
+
}
2858
+
2782
2859
// getting verbose details is an expensive operation, it uses globby to top-down build file structure of project which for large projects can take a few seconds
2783
2860
// for the best UX we show a placeholder api_req_started message with a loading spinner as this happens
0 commit comments