From 3da3849ca13e72b99d575ee6265797e644a14d76 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sat, 2 May 2026 22:50:57 +0200 Subject: [PATCH] fix: purge GOAP tracking state when Instagram is forced to restart --- GramAddict/core/goap.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GramAddict/core/goap.py b/GramAddict/core/goap.py index 9ec7fdf..42cad61 100644 --- a/GramAddict/core/goap.py +++ b/GramAddict/core/goap.py @@ -214,6 +214,15 @@ class GoalExecutor: if success: steps_taken.append({"action": action}) + + if action == "force start instagram": + logger.info("🔄 [GOAP State] App restarted. Purging memory/traps to attempt fresh routing.") + self.action_failures.clear() + explored_nav_actions.clear() + visited_screens.clear() + consecutive_back_presses = 0 + continue + # Check if it was a navigation action (vs a goal action). If we are not on the required screen, # any action taken is essentially a navigation attempt. explored_nav_actions.add(action)