feat: add programmatic alerting for worker lifecycle events (#16) (#17)

Adds notification system for full visibility into the DevClaw pipeline:

Events and targets:
- workerStart: Posted to project group when worker spawns/resumes
- workerComplete: Posted to project group when DEV done/QA pass/fail/refine
- heartbeat: Posted to orchestrator DM with tick summary

Implementation:
- New lib/notify.ts module with buildMessage() and sendMessage()
- Integrated into task_pickup, task_complete, and heartbeat_tick
- Uses OpenClaw gateway to invoke message tool

Configuration (optional):
- orchestratorDm: Chat ID for heartbeat notifications
- notifications.heartbeatDm: Enable/disable heartbeat DM (default: true)
- notifications.workerStart: Enable/disable start notifications (default: true)
- notifications.workerComplete: Enable/disable completion notifications (default: true)

Notifications fail silently (logged but don't break main flow).
This commit is contained in:
Lauren ten Hoor
2026-02-10 00:40:44 +08:00
committed by GitHub
parent c88071db0e
commit d40aa41b16
5 changed files with 354 additions and 1 deletions

View File

@@ -36,6 +36,31 @@ const plugin = {
description: "Work mode: parallel (each project independent) or sequential (1 DEV + 1 QA globally)",
default: "parallel",
},
orchestratorDm: {
type: "string",
description: "Telegram/WhatsApp chat ID for orchestrator DM notifications (heartbeat summaries)",
},
notifications: {
type: "object",
description: "Notification settings for worker lifecycle events",
properties: {
heartbeatDm: {
type: "boolean",
description: "Send heartbeat summaries to orchestrator DM. Default: true",
default: true,
},
workerStart: {
type: "boolean",
description: "Post when worker starts a task. Default: true",
default: true,
},
workerComplete: {
type: "boolean",
description: "Post when worker completes a task. Default: true",
default: true,
},
},
},
},
},