Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: suppress heartbeat alert notifications

Lyric 10f5ae6b 8d8f5920

+19 -1
+14
internal/channelruntime/heartbeat/notifier_test.go
··· 32 32 } 33 33 }) 34 34 35 + t.Run("alert messages are log only", func(t *testing.T) { 36 + called := false 37 + notifier := NotifyFunc(func(ctx context.Context, text string) error { 38 + _ = ctx 39 + _ = text 40 + called = true 41 + return nil 42 + }) 43 + notifyHeartbeat(context.Background(), notifier, nil, "ALERT: heartbeat_failed (boom)") 44 + if called { 45 + t.Fatalf("notifier was called for alert message") 46 + } 47 + }) 48 + 35 49 t.Run("notifier error does not panic", func(t *testing.T) { 36 50 notifier := NotifyFunc(func(ctx context.Context, text string) error { 37 51 _ = ctx
+5 -1
internal/channelruntime/heartbeat/run.go
··· 314 314 if notifier == nil { 315 315 return 316 316 } 317 - if err := notifier.Notify(ctx, strings.TrimSpace(message)); err != nil && logger != nil { 317 + text := strings.TrimSpace(message) 318 + if text == "" || strings.HasPrefix(text, "ALERT:") { 319 + return 320 + } 321 + if err := notifier.Notify(ctx, text); err != nil && logger != nil { 318 322 logger.Warn("heartbeat_notify_error", "error", err.Error()) 319 323 } 320 324 }