fix(cua-driver-rs)(macos): sync agent-cursor registry on click - #1769
Conversation
The `click` tool's two addressing modes — element_index (AXPress) and pixel (x, y) — both animate the agent-cursor overlay to the target, but neither wrote the resulting position back to the CursorRegistry. Only move_cursor did. As a result get_agent_cursor_state always reported `position: null` after a click, even though the overlay had moved to the element: the state query and the rendered overlay were tracked in two places that were never synced. Mirror each animate_cursor_to(...) with a cursor_registry.update_position() call on both paths so the reported state matches what is rendered, regardless of which addressing mode drove the click. Pure state-reporting fix — clicking behaviour is unchanged. Docs: note in mcp-tools.mdx that get_agent_cursor_state.position now tracks click-driven movement, not just explicit move_cursor calls. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesCursor State Synchronization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The
clicktool has two addressing modes — element_index (AXPress) and pixel (x, y). Both animate the agent-cursor overlay to the target, but neither wrote the resulting position back to theCursorRegistry. Onlymove_cursordid.As a result,
get_agent_cursor_statealways reportedposition: nullafter a click, even though the overlay had moved to the element. The state query and the rendered overlay were tracked in two separate places that were never synced — so a backgrounded automation clicking viaelement_index(the recommended path) could never report where its cursor was.Fix
Mirror each
animate_cursor_to(...)with acursor_registry.update_position("default", x, y)call on both paths inclick.rs(AX path + pixel path), so the reported state matches what is actually rendered regardless of which mode drove the click.Pure state-reporting fix — clicking behaviour itself is unchanged.
Verification
cargo check -p platform-macos→ exit 0.Follow-up
A docs note for
get_agent_cursor_state(thatpositionnow tracks click-driven movement) will land in a separate PR.🤖 Generated with Claude Code
Summary by CodeRabbit