diff --git a/agent_v0/deploy/windows_client/agent_v1/main.py b/agent_v0/deploy/windows_client/agent_v1/main.py index a18b0e1b8..dd7c8cdac 100644 --- a/agent_v0/deploy/windows_client/agent_v1/main.py +++ b/agent_v0/deploy/windows_client/agent_v1/main.py @@ -319,7 +319,22 @@ class AgentV1: if img_hash != self._last_heartbeat_hash: self._last_heartbeat_hash = img_hash self.streamer.push_image(full_path, f"heartbeat_{int(time.time())}") - self.streamer.push_event({"type": "heartbeat", "image": full_path, "timestamp": time.time(), "machine_id": self.machine_id}) + heartbeat_event = { + "type": "heartbeat", + "image": full_path, + "timestamp": time.time(), + "machine_id": self.machine_id, + } + # QW1 — enrichissement multi-écrans (monitor_index + monitors_geometry) + # Additif, fallback gracieux : sans cet enrichissement, le serveur + # ne reçoit l'info qu'au moment des clics, donc QW1 ne s'active + # pas en continu sur poste Windows multi-écrans. + try: + from .vision.capturer import _enrich_with_monitor_info + _enrich_with_monitor_info(heartbeat_event) + except Exception as e: + logger.debug("QW1 enrichissement heartbeat échoué: %s", e) + self.streamer.push_event(heartbeat_event) except Exception as e: logger.error(f"Heartbeat error: {e}") time.sleep(5)