From b85d3aaf8c044e61ca1db5dc17fc0916d32318fe Mon Sep 17 00:00:00 2001 From: dj-oyu <68707227+dj-oyu@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:05:27 +0900 Subject: [PATCH] Fix PR linter findings for heartbeat routing changes --- pkg/agent/loop.go | 2 +- pkg/agent/loop_test.go | 9 ++++++++- pkg/heartbeat/service.go | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 70b7d2ace..82d9dde26 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -3603,7 +3603,7 @@ func (al *AgentLoop) handleHeartbeatCommand(args []string, msg bus.InboundMessag } arg := strings.ToLower(strings.TrimSpace(args[1])) - threadID := 0 + var threadID int var err error switch arg { diff --git a/pkg/agent/loop_test.go b/pkg/agent/loop_test.go index 01a8ff29b..7c1781253 100644 --- a/pkg/agent/loop_test.go +++ b/pkg/agent/loop_test.go @@ -1068,7 +1068,14 @@ func TestSplitChatAndThread(t *testing.T) { t.Run(tt.name, func(t *testing.T) { gotChatID, gotThread := splitChatAndThread(tt.chatID) if gotChatID != tt.wantChatID || gotThread != tt.wantThread { - t.Fatalf("splitChatAndThread(%q) = (%q, %d), want (%q, %d)", tt.chatID, gotChatID, gotThread, tt.wantChatID, tt.wantThread) + t.Fatalf( + "splitChatAndThread(%q) = (%q, %d), want (%q, %d)", + tt.chatID, + gotChatID, + gotThread, + tt.wantChatID, + tt.wantThread, + ) } }) } diff --git a/pkg/heartbeat/service.go b/pkg/heartbeat/service.go index 165415105..ef836d31e 100644 --- a/pkg/heartbeat/service.go +++ b/pkg/heartbeat/service.go @@ -273,7 +273,9 @@ func (hs *HeartbeatService) resolveTelegramThreadTarget(threadID int) (channel, if ch != "telegram" || cid == "" { continue } - return ch, withTelegramThread(cid, threadID), fmt.Sprintf("telegram heartbeat_thread_id from %s", candidate.reason) + return ch, + withTelegramThread(cid, threadID), + fmt.Sprintf("telegram heartbeat_thread_id from %s", candidate.reason) } return "", "", ""