From fa8ca476d8de4ddb97bd5bed700e92d15804e659 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Mon, 30 Mar 2026 17:59:15 +0900 Subject: [PATCH] fix: reset task status to active on new human message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user sends a new message while the task is in merge_ready, review_ready, or in_review status, the owner's turn was incorrectly treated as a finalize turn. This caused premature task completion (DONE → completed) even when the user wanted to continue working. Now resets status to active alongside round_trip_count, ensuring the owner gets a fresh working turn instead of a finalize turn. --- src/paired-execution-context.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/paired-execution-context.ts b/src/paired-execution-context.ts index 1f7e050..c85044a 100644 --- a/src/paired-execution-context.ts +++ b/src/paired-execution-context.ts @@ -215,11 +215,17 @@ export function preparePairedExecutionContext(args: { const now = new Date().toISOString(); if (roomRoleContext.role === 'owner') { - // New human message → new ping-pong cycle. Reset the round trip counter - // so previous interactions don't block the auto-review trigger. - if (latestTask.round_trip_count > 0) { + // New human message → new ping-pong cycle. Reset round trip counter + // AND status so the owner turn is not treated as a finalize turn. + const needsReset = + latestTask.round_trip_count > 0 || + latestTask.status === 'merge_ready' || + latestTask.status === 'review_ready' || + latestTask.status === 'in_review'; + if (needsReset) { updatePairedTask(latestTask.id, { round_trip_count: 0, + status: 'active', updated_at: now, }); }