fix: add structural fast path for following/followers to prevent VLM hallucination

This commit is contained in:
2026-04-27 22:08:30 +02:00
parent 1c38dabe79
commit e37d92cdfd

View File

@@ -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: