chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -14,7 +14,9 @@ export function scheduleFollowupDrain(
runFollowup: (run: FollowupRun) => Promise<void>,
): void {
const queue = FOLLOWUP_QUEUES.get(key);
if (!queue || queue.draining) return;
if (!queue || queue.draining) {
return;
}
queue.draining = true;
void (async () => {
try {
@@ -28,7 +30,9 @@ export function scheduleFollowupDrain(
// Debug: `pnpm test src/auto-reply/reply/queue.collect-routing.test.ts`
if (forceIndividualCollect) {
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await runFollowup(next);
continue;
}
@@ -55,7 +59,9 @@ export function scheduleFollowupDrain(
if (isCrossChannel) {
forceIndividualCollect = true;
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await runFollowup(next);
continue;
}
@@ -63,7 +69,9 @@ export function scheduleFollowupDrain(
const items = queue.items.splice(0, queue.items.length);
const summary = buildQueueSummaryPrompt({ state: queue, noun: "message" });
const run = items.at(-1)?.run ?? queue.lastRun;
if (!run) break;
if (!run) {
break;
}
// Preserve originating channel from items when collecting same-channel.
const originatingChannel = items.find((i) => i.originatingChannel)?.originatingChannel;
@@ -96,7 +104,9 @@ export function scheduleFollowupDrain(
const summaryPrompt = buildQueueSummaryPrompt({ state: queue, noun: "message" });
if (summaryPrompt) {
const run = queue.lastRun;
if (!run) break;
if (!run) {
break;
}
await runFollowup({
prompt: summaryPrompt,
run,
@@ -106,7 +116,9 @@ export function scheduleFollowupDrain(
}
const next = queue.items.shift();
if (!next) break;
if (!next) {
break;
}
await runFollowup(next);
}
} catch (err) {