Skip to content

Commit 0e66025

Browse files
author
easonLiangWorldedtech
committed
fix(task): keep main's abort re-check in ask
Porting this unit's delta onto the rebuilt base dropped the re-check, so an abort during the getState/checkAutoApproval awaits posted an ask row again. The unit's own change is the pause handling. The registry import and field are already declared by U3, so this unit does not re-add them.
1 parent 4384441 commit 0e66025

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/core/task/Task.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,14 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
18211821
const isAutoAnswered = approval.decision === "approve" || approval.decision === "deny"
18221822
const autoApprovalDecision = isAutoAnswered ? approval.decision : undefined
18231823

1824+
// Re-check: an abort during the getState/checkAutoApproval awaits must not post an ask row.
1825+
if (this.abort) {
1826+
if (queuedMessage) {
1827+
this.messageQueueService.releaseMessage(queuedMessage.id)
1828+
}
1829+
throw new Error(`[RooCode#ask] task ${this.taskId}.${this.instanceId} aborted`)
1830+
}
1831+
18241832
if (partial !== undefined) {
18251833
const lastMessage = this.clineMessages.at(-1)
18261834

0 commit comments

Comments
 (0)