@@ -108,8 +108,6 @@ export type TaskEvents = {
108108 taskCompleted : [ taskId : string , tokenUsage : TokenUsage , toolUsage : ToolUsage ]
109109 taskTokenUsageUpdated : [ taskId : string , tokenUsage : TokenUsage ]
110110 taskToolFailed : [ taskId : string , tool : ToolName , error : string ]
111- taskBusy : [ taskId : string ]
112- taskFree : [ taskId : string ]
113111}
114112
115113export type TaskEventHandlers = {
@@ -712,7 +710,9 @@ export class Task extends EventEmitter<TaskEvents> {
712710 await this . addToClineMessages ( { ts : askTs , type : "ask" , ask : type , text, isProtected } )
713711 }
714712
713+ console . log ( `[Task#${ this . taskId } ] pWaitFor askResponse...` , type )
715714 await pWaitFor ( ( ) => this . askResponse !== undefined || this . lastMessageTs !== askTs , { interval : 100 } )
715+ console . log ( `[Task#${ this . taskId } ] pWaitFor askResponse done!` , this . askResponse )
716716
717717 if ( this . lastMessageTs !== askTs ) {
718718 // Could happen if we send multiple asks in a row i.e. with
@@ -1019,7 +1019,7 @@ export class Task extends EventEmitter<TaskEvents> {
10191019 const lastClineMessage = this . clineMessages
10201020 . slice ( )
10211021 . reverse ( )
1022- . find ( ( m ) => ! ( m . ask === "resume_task" || m . ask === "resume_completed_task" ) ) // could be multiple resume tasks
1022+ . find ( ( m ) => ! ( m . ask === "resume_task" || m . ask === "resume_completed_task" ) ) // Could be multiple resume tasks.
10231023
10241024 let askType : ClineAsk
10251025 if ( lastClineMessage ?. ask === "completion_result" ) {
@@ -1030,9 +1030,11 @@ export class Task extends EventEmitter<TaskEvents> {
10301030
10311031 this . isInitialized = true
10321032
1033- const { response, text, images } = await this . ask ( askType ) // calls poststatetowebview
1033+ const { response, text, images } = await this . ask ( askType ) // Calls `postStateToWebview`.
1034+
10341035 let responseText : string | undefined
10351036 let responseImages : string [ ] | undefined
1037+
10361038 if ( response === "messageResponse" ) {
10371039 await this . say ( "user_feedback" , text , images )
10381040 responseText = text
@@ -1572,7 +1574,6 @@ export class Task extends EventEmitter<TaskEvents> {
15721574 let assistantMessage = ""
15731575 let reasoningMessage = ""
15741576 this . isStreaming = true
1575- this . emit ( "taskBusy" , this . taskId )
15761577
15771578 try {
15781579 for await ( const chunk of stream ) {
@@ -1679,7 +1680,6 @@ export class Task extends EventEmitter<TaskEvents> {
16791680 }
16801681 } finally {
16811682 this . isStreaming = false
1682- this . emit ( "taskFree" , this . taskId )
16831683 }
16841684
16851685 if ( inputTokens > 0 || outputTokens > 0 || cacheWriteTokens > 0 || cacheReadTokens > 0 ) {
0 commit comments