Skip to content

Commit 485c32b

Browse files
author
easonLiangWorldedtech
committed
fix(task): keep the abort re-check in ask
Porting this unit's delta onto the rebuilt base dropped main's re-check, so an abort during the getState/checkAutoApproval awaits posted an ask row again. Restoring it; the unit's own change is only the pause handling. 7 tests pass, tsc clean, ESLint --max-warnings=0 clean.
1 parent ae52376 commit 485c32b

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)