From 847438177e7e1aba0dd60f8fc240c8f8dfa9b31f Mon Sep 17 00:00:00 2001 From: William Mantly Date: Tue, 4 Aug 2026 18:53:04 -0400 Subject: [PATCH] fix: silently ignore heartbeat_ack instead of logging 'Unknown command type' (v1.3.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The server replies to the agent's own heartbeat with heartbeat_ack; the agent had no case for it, so it fell through to the unknown-command handler, logged 'Unknown command type: heartbeat_ack' every minute, and answered with a spurious error response. heartbeats are fire-and-forget acks — nothing to run, nothing to reply. --- websocket.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/websocket.go b/websocket.go index 23cb365..2651ba8 100644 --- a/websocket.go +++ b/websocket.go @@ -311,6 +311,13 @@ func handleCommand(cm *ConfigManager, msg WSMessage, c MessageWriter, exec Execu respPayload, _ := json.Marshal(resp) c.WriteMessage(websocket.TextMessage, respPayload) return + // heartbeat_ack is the server's acknowledgement of the agent's own periodic + // heartbeat (the agent sends `heartbeat`, the server answers `heartbeat_ack`). + // There is nothing to do with it -- it is not a command to run, and answering + // an ack with an error response would inject spurious errors into the + // command-response channel every minute. Silently ignore. + case "heartbeat_ack": + return default: log.Printf("Unknown command type: %s", msg.Type) sendResponse("error", "unknown command type")