From b1a3aa16f116041b4ca18920f3d405cef29b9bf2 Mon Sep 17 00:00:00 2001 From: Dom Date: Wed, 6 May 2026 00:02:11 +0200 Subject: [PATCH] fix(qw1): enrichir heartbeat Windows avec monitor_index + monitors_geometry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avant ce fix, le _heartbeat_loop côté Agent V1 deploy Windows n'enrichissait pas son payload, donc QW1 multi-écran ne s'activait sur Windows que via les events window_capture (déclenchés par les clics), pas en continu. La source agent_v0/agent_v1/main.py portait déjà l'enrichissement (commit 2d71e2a24) mais le snapshot deploy/windows_client/agent_v1/main.py n'avait pas été synchronisé. Désormais chaque heartbeat porte monitor_index + monitors_geometry, le serveur peut donc résoudre l'écran cible en permanence, même sans clic. Co-Authored-By: Claude Opus 4.7 (1M context) --- agent_v0/deploy/windows_client/agent_v1/main.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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)