From dcadb77548bfcc323fc11c1ccb24c2912f11b612 Mon Sep 17 00:00:00 2001 From: Ngoc Trung Date: Tue, 22 Sep 2026 13:23:47 +0700 Subject: [PATCH] fix(channels): clear failure kind after recovery Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- internal/channels/health.go | 1 + internal/channels/health_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/internal/channels/health.go b/internal/channels/health.go index 0ad1d97c..333eaba7 100644 --- a/internal/channels/health.go +++ b/internal/channels/health.go @@ -304,6 +304,7 @@ func mergeChannelHealth(previous, snapshot ChannelHealth) ChannelHealth { } snapshot.ConsecutiveFailures = 0 snapshot.FirstFailedAt = time.Time{} + snapshot.FailureKind = "" if snapshot.LastFailedAt.IsZero() { snapshot.LastFailedAt = previous.LastFailedAt } diff --git a/internal/channels/health_test.go b/internal/channels/health_test.go index 52bd5646..c11e6dea 100644 --- a/internal/channels/health_test.go +++ b/internal/channels/health_test.go @@ -504,6 +504,9 @@ func TestMergeChannelHealthTracksFailureTimelineAndRecovery(t *testing.T) { recovered.CheckedAt = recoveredAt recovered = mergeChannelHealth(second, recovered) + if recovered.FailureKind != "" { + t.Fatalf("expected failure kind to clear after recovery, got %q", recovered.FailureKind) + } if recovered.ConsecutiveFailures != 0 { t.Fatalf("expected consecutive failures reset, got %d", recovered.ConsecutiveFailures) }