feat: implement workerStart notifications for tick pickups and enhance tick handling

This commit is contained in:
Lauren ten Hoor
2026-02-10 23:14:12 +08:00
parent 41caa13050
commit ff83c25e8c
6 changed files with 107 additions and 27 deletions

View File

@@ -9,7 +9,7 @@ import { jsonResult } from "openclaw/plugin-sdk";
import type { ToolContext } from "../types.js";
import { readProjects } from "../projects.js";
import { log as auditLog } from "../audit.js";
import { notify, getNotificationConfig } from "../notify.js";
import { notify, notifyTickPickups, getNotificationConfig } from "../notify.js";
import { checkWorkerHealth, type HealthFix } from "../services/health.js";
import { projectTick, type TickAction } from "../services/tick.js";
import { requireWorkspaceDir, resolveContext, resolveProvider, getPluginConfig } from "../tool-helpers.js";
@@ -91,6 +91,12 @@ export function createAutoPickupTool(api: OpenClawPluginApi) {
pickups.push(...result.pickups.map((p) => ({ ...p, project: current.name })));
skipped.push(...result.skipped.map((s) => ({ project: current.name, ...s })));
pickupCount += result.pickups.length;
// Send workerStart notifications for each pickup in this project
if (!dryRun && result.pickups.length > 0) {
const notifyConfig = getNotificationConfig(pluginConfig);
await notifyTickPickups(result.pickups, { workspaceDir, config: notifyConfig, channel: current.channel ?? "telegram" });
}
for (const p of result.pickups) {
if (p.role === "dev") globalActiveDev++; else globalActiveQa++;
}