From e37d92cdfd3a974454b0f1912df27e382956cb08 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 27 Apr 2026 22:08:30 +0200 Subject: [PATCH] fix: add structural fast path for following/followers to prevent VLM hallucination --- GramAddict/core/telepathic_engine.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/GramAddict/core/telepathic_engine.py b/GramAddict/core/telepathic_engine.py index 85aac9e..b476c8a 100644 --- a/GramAddict/core/telepathic_engine.py +++ b/GramAddict/core/telepathic_engine.py @@ -155,6 +155,26 @@ class TelepathicEngine: grid_items.sort(key=lambda n: (n.get("y", 9999), n.get("x", 9999))) return grid_items[0] + # --- Profile Structural Fast Paths --- + if "following list" in intent_lower or "followers list" in intent_lower: + target_id = "profile_header_following" if "following" in intent_lower else "profile_header_followers" + for n in nodes: + res_id = n.get("id", "") or n.get("resource_id", "") + if target_id in res_id: + return n + # Fallback to text matching if ID not found + for n in nodes: + sem = (n.get("semantic_string", "") or "").lower() + desc = (n.get("description", "") or "").lower() + text = (n.get("text", "") or "").lower() + + if "following" in intent_lower: + if "following" in sem or "abonniert" in sem or "following" in desc or "following" in text: + return n + else: + if "followers" in sem or "abonnenten" in sem or "followers" in desc or "followers" in text: + return n + # --- DM Engine Structural Fast Paths --- if "find the message input text field" in intent_lower: for n in nodes: