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.
This commit is contained in:
@@ -484,6 +484,16 @@ export function completePairedExecutionContext(args: {
|
|||||||
case 'done_with_concerns':
|
case 'done_with_concerns':
|
||||||
case 'continue':
|
case 'continue':
|
||||||
default:
|
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
|
// Owner needs to address feedback — ping-pong continues
|
||||||
updatePairedTask(taskId, { status: 'active', updated_at: now });
|
updatePairedTask(taskId, { status: 'active', updated_at: now });
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user