fix(agent): prevent stuck loop by adding action history to LLM prompt

The UI agent had no memory of previous actions — each step was a fresh
single-shot LLM call. After typing and sending a message, the LLM saw
an empty text field and retyped the message in a loop.

- Add RECENT_ACTIONS (last 5 actions with text/result) to user prompt
- Add chat app completion detection rule to dynamic prompt
- Add send-success hints for WhatsApp and Messages apps
- Add git convention to CLAUDE.md (no co-author lines)
This commit is contained in:
Sanju Sivalingam
2026-02-18 00:53:13 +05:30
parent 9193b02d36
commit db995e4913
4 changed files with 26 additions and 0 deletions

View File

@@ -63,3 +63,7 @@ Copy `.env.example` to `.env` and configure `LLM_PROVIDER` + the corresponding A
## Device Assumptions
Swipe coordinates in `constants.ts` are hardcoded for 1080px-wide screens (center X=540, center Y=1200). Adjust `SWIPE_COORDS` and `SCREEN_CENTER_*` for different resolutions.
## Git Conventions
- Do NOT add `Co-Authored-By: Claude` lines to commit messages.