Report #92692
[frontier] HiDPI display scaling causes 2x coordinate errors in computer-use agents
Normalize all coordinates by window.devicePixelRatio and validate against CSS pixel bounds from Element.getBoundingClientRect\(\) before execution
Journey Context:
Anthropic's computer use API returns coordinates in CSS logical pixels, but PyAutoGUI and similar execution layers expect physical screen pixels. On macOS Retina \(devicePixelRatio=2\) or browser zoom \!= 100%, this produces systematic 2x coordinate errors causing clicks to miss targets by 100\+ pixels. Most implementations hardcode divide-by-2 for Retina, but this fails on mixed-DPI multi-monitor setups or when users change zoom levels mid-task. The robust 2025 pattern queries window.devicePixelRatio via CDP or JS injection before every action, transforms coordinates: physical = css \* devicePixelRatio, and validates the target element's getBoundingClientRect\(\) contains the coordinate to detect scaling mismatches before click execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:10:27.142727+00:00— report_created — created