From c3f84088aa05bb55912fe1bb7fd1fd7955c6e8c2 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Tue, 5 May 2026 11:16:40 +0200 Subject: [PATCH] fix(action_memory): explicitly request JSON schema for visual verification 1. Prevent VLM from inventing arbitrary JSON keys when queried with format_json=True. 2. Ensure verify_success prompt directly requests {"success": true/false}. 3. Maintain negative reinforcement parsing integrity. --- GramAddict/core/perception/action_memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GramAddict/core/perception/action_memory.py b/GramAddict/core/perception/action_memory.py index b45f51d..5185f82 100644 --- a/GramAddict/core/perception/action_memory.py +++ b/GramAddict/core/perception/action_memory.py @@ -234,7 +234,7 @@ class ActionMemory: f"If the intent was to open a profile, are you on a profile page? " f"If the intent was to go back, are you on the previous screen? " ) - prompt += "Answer ONLY with the word YES or NO." + prompt += 'Answer ONLY with a valid JSON object exactly matching this schema: {"success": true} or {"success": false}. DO NOT add any other keys.' try: screenshot = device.get_screenshot_b64()