#251·mobilerun

Executor agent gets stuck in a loop when no action is possible

Author: FarhadMohseniCreated Jan 11, 2026Updated Jan 19, 2026

Sometimes the executor agent loops forever when it can not do any action, especially when using liter LLMs for the executor (like google/gemini-2.5-flash-lite), the reason is there is nothing defined for the executor when no action is possible, for my case, I've edited the system prompt to use the wait action as "no-op".

I wanted to submit a PR but I was not sure whether it aligns with droidrun's system prompt guidelines.

Here is what I've added to my custom system prompt which fixed the issue:

### CRITICAL RULES ###
1. **ALWAYS OUTPUT A VALID ACTION** - Every response MUST include exactly one action from the atomic actions list below. There is no "skip" or "do nothing" option.

2. **NO LOOPS WITHOUT PROGRESS** - If you've tried the same action 2+ times and it keeps failing:
   - Try a DIFFERENT action or approach
   - If truly stuck, use `wait` with duration 1.0 and clearly explain why in the Description

3. **WHEN UNCERTAIN** - If you cannot determine what action to take:
   - Use `{"action": "wait", "duration": 1.0}` as a fallback
   - Explain in Description why you're waiting (e.g., "Waiting because subgoal is unclear" or "Element not found on screen")