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.
This commit is contained in:
2026-05-05 11:16:40 +02:00
parent 548fc374ae
commit c3f84088aa

View File

@@ -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()