Revert "fix(navigation): eliminate VLM hallucination on bottom navigation tabs via structural guard"
This reverts commit b9c29a5a2d.
This commit is contained in:
@@ -254,27 +254,11 @@ class IntentResolver:
|
||||
and "per cent" not in (n.content_desc or "").lower()
|
||||
]
|
||||
|
||||
# --- Structural Navigation Guard ---
|
||||
# For strictly defined navigation tabs, we bypass the VLM entirely.
|
||||
tab_mapping = {
|
||||
"tap home tab": "feed_tab",
|
||||
"tap explore tab": "search_tab",
|
||||
"tap reels tab": "clips_tab",
|
||||
"tap profile tab": "profile_tab",
|
||||
"tap messages tab": "direct_tab",
|
||||
}
|
||||
intent_lower = intent_description.lower()
|
||||
if intent_lower in tab_mapping:
|
||||
target_id = tab_mapping[intent_lower]
|
||||
for node in candidates:
|
||||
if target_id in (node.resource_id or ""):
|
||||
logger.info(f"🎯 [Navigation Guard] Exact match found for '{intent_lower}' via resource-id. Skipping VLM.")
|
||||
return node
|
||||
|
||||
# --- Strict Button Guard ---
|
||||
# If the intent specifically asks for a "button", "icon", or "tab",
|
||||
# filter out candidates that contain long text (e.g. captions, comments)
|
||||
# to prevent the VLM from hallucinating text nodes as interactive buttons.
|
||||
intent_lower = intent_description.lower()
|
||||
if "button" in intent_lower or "icon" in intent_lower or "tab" in intent_lower:
|
||||
filtered_candidates = []
|
||||
for node in candidates:
|
||||
|
||||
Reference in New Issue
Block a user