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

@@ -1411,6 +1411,17 @@ export function deleteTask(id: string): void {
}
}
export function hasActiveCiWatcherForChat(chatJid: string): boolean {
const row = db
.prepare(
`SELECT 1 FROM scheduled_tasks
WHERE chat_jid = ? AND status = 'active' AND prompt LIKE '[BACKGROUND CI WATCH]%'
LIMIT 1`,
)
.get(chatJid);
return !!row;
}
export function getDueTasks(): ScheduledTask[] {
const now = new Date().toISOString();
return db