feat(notifications): operational webhook alerts for daemon events#292
Merged
Conversation
Add a webhook notification channel that POSTs structured JSON to configured HTTP endpoints when operational events require human attention. Supports multiple webhook targets, deduplication, and retry with exponential backoff. Alert types: mcp.auth.expired, mcp.server.disconnected, channel.disconnected, provider.failover, provider.unreachable, provider.auth.expired (reserved). Emission points: - McpClientManager: MCP server connection failures and OAuth re-auth required - FailoverChatClient: primary→fallback failover and both-providers-down - AlertingChatClientDecorator: single-provider unreachable (no fallback) - SlackChannel: Slack connection failure at startup Init wizard: optional webhook URL input added to the Exposure step. Config schema: Notifications section with Webhooks array, dedup window, retry count, and timeout settings. Also fixes flaky Reconcile_disables_zombie_oneshot_reminders test by replacing blocking .Result with async await and increasing poll timeout.
Closed
- Add ReminderExecutionFailed and ReminderAutoDisabled alert types - Emit warning alert when a reminder execution fails - Emit critical alert when a reminder is auto-disabled after hitting the failure threshold - Inject IOperationalNotificationSink into ReminderManagerActor - Add ReconcileCompleted ack to HandleReconcileAsync so callers can synchronize on completion instead of polling - Fix flaky Reconcile_disables_zombie_oneshot_reminders test by replacing Tell + AwaitAssertAsync with deterministic Ask pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #291
McpClientManager(MCP auth expired, server disconnected),FailoverChatClient(provider failover, both providers unreachable),AlertingChatClientDecorator(single-provider unreachable), andSlackChannel(connection failure at startup)netclaw-config.v1.schema.jsonwith theNotificationssectionReconcile_disables_zombie_oneshot_reminderstest (blocking.Result→ asyncawait, increased polling timeout)Alert types
mcp.auth.expiredmcp.server.disconnectedchannel.disconnectedprovider.failoverprovider.unreachableprovider.auth.expiredExample config
{ "Notifications": { "Webhooks": [ { "Url": "https://hooks.slack.com/services/T.../B.../xxx" }, { "Url": "https://ntfy.sh/netclaw-alerts", "Name": "ntfy" } ], "DeduplicationWindowSeconds": 300, "MaxRetries": 2, "TimeoutSeconds": 10 } }Example webhook payload
{ "alertId": "a1b2c3d4e5f6", "type": "mcp.server.disconnected", "severity": "warning", "summary": "MCP server 'memorizer' connection failed: Connection refused", "timestamp": "2026-03-19T14:30:00.000Z", "source": "netclaw", "hostname": "pi1", "context": { "serverName": "memorizer" } }Test plan
dotnet buildpassesWebhookNotificationServicecovering delivery, dedup, multi-target, headers, retry, graceful degradationnetclaw.json, start daemon with misconfigured MCP server, verify POST receivedNullNotificationSinkused (log-only)