From 3e607d734466df99d7f453237aa1406e56cdc1d8 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Sun, 29 Mar 2026 19:08:07 +0900 Subject: [PATCH] fix: enqueue next turn after paired execution so reviewer runs without new message --- src/message-agent-executor.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/message-agent-executor.ts b/src/message-agent-executor.ts index acf765d..1f1266c 100644 --- a/src/message-agent-executor.ts +++ b/src/message-agent-executor.ts @@ -64,7 +64,7 @@ import type { RegisteredGroup } from './types.js'; export interface MessageAgentExecutorDeps { assistantName: string; - queue: Pick; + queue: Pick; getRegisteredGroups: () => Record; getSessions: () => Record; persistSession: (groupFolder: string, sessionId: string) => void; @@ -888,12 +888,19 @@ export async function runAgentForGroup( return 'success'; } finally { if (pairedExecutionContext) { + const completedRole = roomRoleContext?.role ?? 'owner'; completePairedExecutionContext({ taskId: pairedExecutionContext.task.id, - role: roomRoleContext?.role ?? 'owner', + role: completedRole, status: pairedExecutionStatus, summary: pairedExecutionSummary, }); + + // After owner/reviewer completes, enqueue the next turn so + // the message loop picks it up without waiting for a new message. + if (pairedExecutionStatus === 'succeeded') { + deps.queue.enqueueMessageCheck(chatJid); + } } } }