Fix paired turn follow-up scheduling

This commit is contained in:
ejclaw
2026-04-06 21:58:22 +09:00
parent 8ae9e383c0
commit ac91e84441
3 changed files with 12 additions and 4 deletions

View File

@@ -130,7 +130,7 @@ describe('message-agent-executor-rules', () => {
).toBe('pending');
});
it('does not request a generic follow-up after successful owner output moved the task to review_ready', () => {
it('requests a generic follow-up after successful owner output moved the task to review_ready', () => {
expect(
resolvePairedFollowUpQueueAction({
completedRole: 'owner',
@@ -138,7 +138,7 @@ describe('message-agent-executor-rules', () => {
sawOutput: true,
taskStatus: 'review_ready',
}),
).toBe('none');
).toBe('generic');
});
it('does not request a generic follow-up after successful reviewer output moved the task back to active', () => {

View File

@@ -124,6 +124,13 @@ export function resolvePairedFollowUpQueueAction(args: {
taskStatus: PairedTaskStatus | null;
}): PairedFollowUpQueueAction {
if (args.executionStatus === 'succeeded' && args.sawOutput) {
if (
args.completedRole === 'owner' &&
args.taskStatus === 'review_ready'
) {
return 'generic';
}
return args.completedRole === 'reviewer' &&
args.taskStatus === 'merge_ready'
? 'skip-inline-finalize'

View File

@@ -1238,7 +1238,7 @@ describe('runAgentForGroup room memory', () => {
expect(deps.queue.enqueueMessageCheck).not.toHaveBeenCalled();
});
it('does not enqueue a generic follow-up when owner output already moved the task to review_ready', async () => {
it('enqueues a generic follow-up when owner output moved the task to review_ready', async () => {
const group = { ...makeGroup(), folder: 'test-group' };
const deps = makeDeps();
@@ -1311,7 +1311,8 @@ describe('runAgentForGroup room memory', () => {
});
expect(result).toBe('success');
expect(deps.queue.enqueueMessageCheck).not.toHaveBeenCalled();
expect(deps.queue.enqueueMessageCheck).toHaveBeenCalledTimes(1);
expect(deps.queue.enqueueMessageCheck).toHaveBeenCalledWith('group@test');
});
it('does not enqueue a generic follow-up when reviewer output already returned the task to active', async () => {