fix(navigation): purge structural guards and enforce pure VLM discovery for bottom tabs

Removed the hardcoded structural fallback bypasses for bottom navigation tabs to ensure 100% autonomous visual inference. Expanded the VLM intent resolution prompt with explicit spatial heuristics for bottom navigation (e.g., 'profile tab is the avatar icon at the bottom right') to prevent LLaVA hallucinations without resorting to XML resource-id hacks. Added E2E visual test proof.
This commit is contained in:
2026-04-29 01:23:20 +02:00
parent 03105437b8
commit e55abc5a8a
2 changed files with 47 additions and 2 deletions

View File

@@ -278,7 +278,7 @@ class IntentResolver:
# Posts/grid items usually have 'row X, column Y', 'photos by', or 'reel by'
if "row 1" in desc or "column" in desc or "photos by" in desc or "reel by" in desc:
grid_candidates.append(node)
if grid_candidates:
logger.info(f"🎯 [Grid Guard] Filtered to {len(grid_candidates)} actual grid candidates.")
candidates = grid_candidates
@@ -361,7 +361,13 @@ class IntentResolver:
f"4. Ignore numbers inside the text itself. Do not confuse the text '19' with Box [19].\n"
f"5. If the intent contains 'following', you MUST pick the box containing 'following'. Do NOT pick 'followers' or 'Follow'.\n"
f"6. If the intent is to tap a 'post' or 'grid item', look for boxes with descriptions containing 'photos by', 'Reel by', or 'row 1, column 1' and pick the first matching one. Do NOT pick navigation buttons like 'Search'.\n"
f"7. If the exact control is NOT visible, return null. Do NOT guess.\n\n"
f"7. If the intent is a bottom navigation tab (e.g. 'profile tab', 'home tab'):\n"
f" - These are always at the BOTTOM edge of the screen.\n"
f" - 'profile tab' is usually the furthest right icon (your avatar).\n"
f" - 'home tab' is the furthest left icon (house).\n"
f" - 'explore tab' is the magnifying glass.\n"
f" - 'reels tab' is the video clapperboard.\n"
f"8. If the exact control is NOT visible, return null. Do NOT guess.\n\n"
f'Reply ONLY with a valid JSON object: {{"box": <number>}} or {{"box": null}}'
)