feat: skip auto-review when active CI watcher exists

When the owner registers a CI watcher and completes the turn, the
review loop no longer triggers. The watcher result will be posted
via the reviewer bot, which the owner picks up and acts on, then
the normal review loop resumes.
This commit is contained in:
Eyejoker
2026-03-30 04:11:30 +09:00
parent 0ae937c4e2
commit e13c1df520
2 changed files with 23 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import {
getLatestOpenPairedTaskForChat,
getPairedTaskById,
getPairedWorkspace,
hasActiveCiWatcherForChat,
updatePairedTask,
upsertPairedProject,
} from './db.js';
@@ -390,6 +391,17 @@ export function completePairedExecutionContext(args: {
}
}
// Active CI watcher → skip auto-review until watcher completes.
// The watcher result will be posted via reviewer bot, triggering
// the owner to act on it, which then resumes the review loop.
if (hasActiveCiWatcherForChat(task.chat_jid)) {
logger.info(
{ taskId, chatJid: task.chat_jid },
'Active CI watcher found, deferring auto-review until watcher completes',
);
return;
}
// Normal turn → auto-trigger reviewer (if within round trip limit)
if (task.round_trip_count >= PAIRED_MAX_ROUND_TRIPS) {
logger.info(