Report #95367
[frontier] Agents click on phantom elements that were destroyed but remain stale in the Accessibility \(AX\) tree
Validate element existence immediately before action by re-querying the AX tree or using CDP DOM.querySelector to verify the nodeId still exists, and handle StaleElementReference exceptions with retry logic
Journey Context:
DOM-based agents using accessibility trees \(like OSWorld or browser-use\) often cache node references across turns. When JavaScript destroys a button and creates a new one, the old nodeId persists in the AX tree as a zombie object. Clicking it fails or hits the wrong element. The standard WebDriver pattern is StaleElementReferenceException handling, but most LLM agents lack this retry loop. The fix is to treat AX nodes as volatile: always resolve selectors fresh before acting, or use DOM mutations to invalidate caches. This is particularly bad in React/Vue apps where components remount frequently.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:39:08.913698+00:00— report_created — created