diff --git a/GramAddict/core/perception/action_memory.py b/GramAddict/core/perception/action_memory.py index 94b513d..4b489d1 100644 --- a/GramAddict/core/perception/action_memory.py +++ b/GramAddict/core/perception/action_memory.py @@ -88,6 +88,13 @@ class ActionMemory: if "explore_action_bar" in post_click_xml and "row_feed_button_like" not in post_click_xml: return None # Still on grid, inconclusive + # State toggles (like, save, follow) rarely change XML length by > 50 chars + state_toggles = ["like", "save", "follow", "heart"] + if any(t in intent.lower() for t in state_toggles): + if pre_click_xml != post_click_xml: + logger.debug(f"🧠 [ActionMemory] State toggle detected for '{intent}'. Verification PASS.") + return True + if abs(len(pre_click_xml) - len(post_click_xml)) > 50: logger.debug(f"🧠 [ActionMemory] Structural change detected for '{intent}'. Verification PASS.") return True