From 27bf36c83379e78404de9d65d0279215e7f4025a Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Mon, 30 Mar 2026 21:00:31 +0900 Subject: [PATCH] fix: break DONE_WITH_CONCERNS echo loop after 3 round trips When both owner and reviewer keep echoing DONE_WITH_CONCERNS without making progress, the system now stops the ping-pong after 3 round trips and sets the task to completed, escalating to the user. --- src/paired-execution-context.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/paired-execution-context.ts b/src/paired-execution-context.ts index e311cb1..d9b859e 100644 --- a/src/paired-execution-context.ts +++ b/src/paired-execution-context.ts @@ -484,6 +484,16 @@ export function completePairedExecutionContext(args: { case 'done_with_concerns': case 'continue': default: + // If both sides keep echoing DONE_WITH_CONCERNS without progress, + // stop the loop after 3 round trips to prevent infinite ping-pong. + if (task.round_trip_count >= 3) { + updatePairedTask(taskId, { status: 'completed', updated_at: now }); + logger.info( + { taskId, verdict, roundTrips: task.round_trip_count }, + 'Stopped ping-pong after repeated DONE_WITH_CONCERNS — escalating to user', + ); + break; + } // Owner needs to address feedback — ping-pong continues updatePairedTask(taskId, { status: 'active', updated_at: now }); logger.info(