From a846462d0270dc399b3e7bac2ebfb964c3fa617e Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 29 Apr 2026 00:38:58 +0200 Subject: [PATCH] fix(navigation): resolve VLM hallucination on EXPLORE_GRID and optimize GOAP logging 1. Fixed a bug where 'tap first grid item' was not matching the telepathic fast-path string ('first image in explore grid'). This caused the intent to fall through to the VLM for visual discovery. Since 'tap first grid item' is highly ambiguous for a VLM, it hallucinated and selected the search bar (Box 10), causing the keyboard to open and the bot to transition to an UNKNOWN state. 2. Optimized GOAP Step and Brain logging to always explicitly include the user's ultimate goal string, ensuring a transparent 'goal-oriented' debugging trail. --- GramAddict/core/goap.py | 2 +- GramAddict/core/navigation/planner.py | 2 +- GramAddict/core/telepathic_engine.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GramAddict/core/goap.py b/GramAddict/core/goap.py index 572565c..306b0ed 100644 --- a/GramAddict/core/goap.py +++ b/GramAddict/core/goap.py @@ -146,7 +146,7 @@ class GoalExecutor: screen["available_actions"] = masked_available logger.debug( - f"📍 [GOAP Step {step_num + 1}] On: {screen_type.value} | " + f"📍 [GOAP Step {step_num + 1}] Goal: '{goal}' | On: {screen_type.value} | " f"Available: {screen.get('available_actions', [])[:5]}" ) diff --git a/GramAddict/core/navigation/planner.py b/GramAddict/core/navigation/planner.py index 3e9d7d0..676b56f 100644 --- a/GramAddict/core/navigation/planner.py +++ b/GramAddict/core/navigation/planner.py @@ -157,7 +157,7 @@ class GoalPlanner: brain_action = ask_brain_for_action(goal, screen_type.name, available, avoid_actions) if brain_action: - logger.info(f"🧠 [Brain] Decided dynamically to execute: '{brain_action}'") + logger.info(f"🧠 [Brain] Decided to execute: '{brain_action}' (to achieve: '{goal}')") return brain_action # ── 2. HD Map Routing (Fallback) ── diff --git a/GramAddict/core/telepathic_engine.py b/GramAddict/core/telepathic_engine.py index 95eb96a..7220b8e 100644 --- a/GramAddict/core/telepathic_engine.py +++ b/GramAddict/core/telepathic_engine.py @@ -139,7 +139,7 @@ class TelepathicEngine: skip_positions = set() intent_lower = intent_description.lower() - if "first image in explore grid" in intent_lower: + if "first image in explore grid" in intent_lower or "tap first grid item" in intent_lower: grid_items = [ n for n in nodes