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)