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:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user