From b894252d387ba179f07fec5abd60373689b6194a Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 20 Mar 2026 17:33:35 -0600 Subject: [PATCH] Cleanup --- frigate/jobs/vlm_watch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/jobs/vlm_watch.py b/frigate/jobs/vlm_watch.py index b26f5efe44..dae5e5f41d 100644 --- a/frigate/jobs/vlm_watch.py +++ b/frigate/jobs/vlm_watch.py @@ -181,7 +181,9 @@ class VLMWatchRunner(threading.Thread): # Keep system prompt + last _MAX_HISTORY user/assistant pairs max_msgs = 1 + _MAX_HISTORY * 2 if len(self.conversation) > max_msgs: - self.conversation = [self.conversation[0]] + self.conversation[-(max_msgs - 1):] + self.conversation = [self.conversation[0]] + self.conversation[ + -(max_msgs - 1) : + ] try: clean = re.sub( @@ -258,9 +260,7 @@ class VLMWatchRunner(threading.Thread): zones = self.job.zones for obj in tracked_objects: label_ok = not labels or obj.get("label") in labels - zone_ok = not zones or bool( - set(obj.get("current_zones", [])) & set(zones) - ) + zone_ok = not zones or bool(set(obj.get("current_zones", [])) & set(zones)) if label_ok and zone_ok: return True return False