Fix PR linter findings for heartbeat routing changes

This commit is contained in:
dj-oyu 2026-03-04 18:05:27 +09:00
parent 1f94c277ce
commit d6f632f3e2
3 changed files with 12 additions and 3 deletions

View file

@ -3603,7 +3603,7 @@ func (al *AgentLoop) handleHeartbeatCommand(args []string, msg bus.InboundMessag
} }
arg := strings.ToLower(strings.TrimSpace(args[1])) arg := strings.ToLower(strings.TrimSpace(args[1]))
threadID := 0 var threadID int
var err error var err error
switch arg { switch arg {

View file

@ -1068,7 +1068,14 @@ func TestSplitChatAndThread(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
gotChatID, gotThread := splitChatAndThread(tt.chatID) gotChatID, gotThread := splitChatAndThread(tt.chatID)
if gotChatID != tt.wantChatID || gotThread != tt.wantThread { 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,
)
} }
}) })
} }

View file

@ -273,7 +273,9 @@ func (hs *HeartbeatService) resolveTelegramThreadTarget(threadID int) (channel,
if ch != "telegram" || cid == "" { if ch != "telegram" || cid == "" {
continue 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 "", "", "" return "", "", ""