diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 8beaf1235e8c..58ccccc1f096 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -802,6 +802,7 @@ export class Task extends EventEmitter implements TaskLike { const isMessageQueued = !this.messageQueueService.isEmpty() const isStatusMutable = !partial && isBlocking && !isMessageQueued let statusMutationTimeouts: NodeJS.Timeout[] = [] + const statusMutationTimeout = 5_000 if (isStatusMutable) { console.log(`Task#ask will block -> type: ${type}`) @@ -815,7 +816,7 @@ export class Task extends EventEmitter implements TaskLike { this.interactiveAsk = message this.emit(RooCodeEventName.TaskInteractive, this.taskId) } - }, 1_000), + }, statusMutationTimeout), ) } else if (isResumableAsk(type)) { statusMutationTimeouts.push( @@ -826,7 +827,7 @@ export class Task extends EventEmitter implements TaskLike { this.resumableAsk = message this.emit(RooCodeEventName.TaskResumable, this.taskId) } - }, 1_000), + }, statusMutationTimeout), ) } else if (isIdleAsk(type)) { statusMutationTimeouts.push( @@ -837,7 +838,7 @@ export class Task extends EventEmitter implements TaskLike { this.idleAsk = message this.emit(RooCodeEventName.TaskIdle, this.taskId) } - }, 1_000), + }, statusMutationTimeout), ) } } else if (isMessageQueued) { @@ -846,17 +847,19 @@ export class Task extends EventEmitter implements TaskLike { const message = this.messageQueueService.dequeueMessage() if (message) { - // Check if this is a tool approval ask that needs to be handled + // Check if this is a tool approval ask that needs to be handled. if ( type === "tool" || type === "command" || type === "browser_action_launch" || type === "use_mcp_server" ) { - // For tool approvals, we need to approve first, then send the message if there's text/images + // For tool approvals, we need to approve first, then send + // the message if there's text/images. this.handleWebviewAskResponse("yesButtonClicked", message.text, message.images) } else { - // For other ask types (like followup), fulfill the ask directly + // For other ask types (like followup), fulfill the ask + // directly. this.setMessageResponse(message.text, message.images) } }