fix: only reset merge_ready to active when human message is present

The finalize turn (auto-triggered after reviewer approval) was being
treated as a new working turn because merge_ready was unconditionally
reset to active. Now merge_ready is only reset when a human message
is in the batch, preserving the finalize flow for bot-only turns.
This commit is contained in:
Eyejoker
2026-03-30 19:48:25 +09:00
parent f30b25d2b4
commit 78fa078921
3 changed files with 14 additions and 2 deletions

View File

@@ -78,6 +78,7 @@ export async function runAgentForGroup(
runId: string;
startSeq?: number | null;
endSeq?: number | null;
hasHumanMessage?: boolean;
onOutput?: (output: AgentOutput) => Promise<void>;
},
): Promise<'success' | 'error'> {
@@ -159,6 +160,7 @@ export async function runAgentForGroup(
chatJid,
runId,
roomRoleContext,
hasHumanMessage: args.hasHumanMessage,
});
const effectivePrompt = prompt;
let pairedExecutionStatus: 'succeeded' | 'failed' = 'failed';