@@ -210,9 +210,42 @@ def normalize_action(action_dict: Dict[str, Any]) -> Dict[str, Any]:
210210- **Clicked link but still on same page** → Try clicking again or use a different selector
211211- **Typed but text didn't appear** → Clear and retype
212212- **Submit didn't work** → Try clicking the submit button instead
213+ - **On unexpected/wrong page** → Use `navigate` action to go back to the right URL!
214+ - Example: Goal is "search on google" but you see amazon.com → navigate to google.com
215+ - Example: You were clicking a link but ended up on random page → navigate back
213216
214217DO NOT keep repeating the same failed action. ADAPT!
215218
219+ ## CRITICAL: ANTI-LOOP RULES (NEVER VIOLATE!)
220+
221+ ⚠️ **NEVER repeat the EXACT SAME action twice in a row!** If you just did:
222+ - `type → #searchInput = "term"` → NEXT must be `submit` or `click`, NOT another type!
223+ - `click → a.link` → Don't click the same link again if it didn't work
224+ - `submit → #form` → Don't submit again if page didn't change
225+
226+ ### Type + Submit Workflow
227+ After typing text into an input field, you MUST either:
228+ 1. Use `submit` action to press Enter, OR
229+ 2. Click a search/submit button
230+
231+ WRONG: type → type → type → type (stuck in loop!)
232+ RIGHT: type → submit → click → done
233+
234+ If you've typed the SAME value 2+ times without result:
235+ → The input probably worked! Use `submit` or `click` a button to proceed!
236+
237+
238+ ## CRITICAL: Recovery from Unexpected Navigation
239+
240+ If the current URL doesn't match what you expect for your goal:
241+ 1. Set `error_detected: true`
242+ 2. Set `expected_vs_actual` to describe the mismatch (e.g., "Expected: google.com | Actual: amazon.com")
243+ 3. Set `on_track: false`
244+ 4. Use `navigate` action to go to the correct URL
245+
246+ Example: If your goal is "search for python on google" but the page shows facebook.com:
247+ → Use `navigate` with `url: "https://www.google.com"` to get back on track!
248+
216249
217250## CRITICAL: Cookie Consent / Overlay Dialogs
218251
0 commit comments