refactor: centralize notifications in core dispatch/completion functions (#150)

This commit is contained in:
Lauren ten Hoor
2026-02-13 17:00:42 +08:00
parent 80587412ee
commit 265f82f3a9
8 changed files with 72 additions and 88 deletions

View File

@@ -18,7 +18,6 @@ import { log as auditLog } from "../audit.js";
import { checkWorkerHealth, fetchGatewaySessions, type SessionLookup } from "./health.js";
import { projectTick } from "./tick.js";
import { createProvider } from "../providers/index.js";
import { notifyTickPickups, getNotificationConfig } from "../notify.js";
// ---------------------------------------------------------------------------
// Types
@@ -281,15 +280,7 @@ export async function tick(opts: {
result.totalPickups += tickResult.pickups.length;
result.totalSkipped += tickResult.skipped.length;
// Notify project group about any pickups
if (tickResult.pickups.length > 0) {
const notifyConfig = getNotificationConfig(pluginConfig);
await notifyTickPickups(tickResult.pickups, {
workspaceDir,
config: notifyConfig,
channel: project.channel,
});
}
// Notifications now handled by dispatchTask
if (isProjectActive || tickResult.pickups.length > 0) activeProjects++;
}