Skip to content

[FEATURE] Accessibility-tree integration for computer use tools (macOS AX, Linux AT-SPI, Windows UIA) #998

Description

@inference-gateway-maintainer

Summary

The computer use tools (MouseClick, MouseMove, Type, Screenshot) currently interact with the UI by actually moving the mouse and typing, and locate targets purely from pixels via the vision annotator. Every desktop platform exposes an accessibility tree that can answer "what elements are on screen and where" natively - exact positions, labels, and states, no vision model side-call, no cursor movement. Integrating it enables text-only models (like DeepSeek) to perform GUI tasks by reading the tree, with the vision pipeline as fallback.

Acceptance Criteria

  • Add a GetUIElements tool that walks the accessibility tree of the frontmost app or a named target ("dock"/"taskbar", "menubar"), returning the same {label, text, bbox} element shape as the annotator, with coordinates mapped into the standard frame space (one uniform scale conversion via FitDims) so MouseClick and the model's coordinate space stay unchanged.
  • Add a PressUIElement action that invokes an element's default action directly without moving the cursor - eliminates the physical-mouse-interference race and coordinate risk for launches and standard controls.
  • Platform backends behind one interface (mirroring internal/display's provider pattern):
    • macOS: AXUIElement via cgo/ObjC (fits the existing pattern in internal/display/macos/client_darwin.go); the Dock is AXApplication "Dock" -> AXList -> AXDockItem with exact AXTitle/AXPosition/AXSize. Requires the Accessibility (TCC) permission for the spawning process; degrade gracefully with a clear message when not granted.
    • Linux (X11/Wayland): AT-SPI2 over D-Bus - works on both display servers since it bypasses the compositor; degrade clearly when the bus or registry is unavailable.
    • Windows: UI Automation (UIA) - tracked for when the CLI grows a Windows display backend.
  • Background tasks should be able to use the accessibility tree for non-invasive UI inspection.
  • Unsupported platform or missing permission degrades to the vision pipeline with a clear message, never a hard failure.
  • Tool descriptions steer the model: query the tree first, fall back to GetLatestFrame + region zoom when the tree is empty or the app exposes nothing useful.

Context

This is a follow-up from PR #990 and PR #1083. The vision annotation pipeline already lets text-only models understand screen content via the annotator, but they still can't interact with the UI without vision. Accessibility trees provide the same element-level information the annotator extracts from screenshots, but natively.

Findings from the grounding work in PR #1083, where vision-based Dock clicking was verified end to end but measured slow (multiple frame captures + annotator round-trips per target):

  • The CLI has no accessibility-tree usage today on any platform - internal/display uses only NSWorkspace/robotgo (macOS) and X11/Wayland capture+input, so pixels + annotator VLM is the agent's only way to locate UI.
  • Accessibility lookups are deterministic, instant, and token-free exactly where the annotator confabulates (small icons, dense toolbars).
  • The vision pipeline from PR fix(computer-use): dock annotations, single-resample frames, saner frame retention #1083 (region zoom + annotator) stays load-bearing as the fallback for apps with poor accessibility exposure on every platform, e.g. DaVinci Resolve's custom-drawn UI.

Suggested phasing: macOS backend first (primary computer-use platform today), Linux AT-SPI second, Windows UIA when a Windows display backend exists.

For text-only models like DeepSeek, this would enable:

  • Reading button labels and menu items
  • Getting element positions for targeted clicks
  • Understanding UI state without screenshot annotation
  • Performing multi-step GUI workflows via background tasks

Related

Activity

  1. added theissue type on Aug 3, 2026
  2. moved this to Todo in 2026on Aug 3, 2026
  3. changed the title [-][FEATURE] macOS Accessibility API integration for computer use tools[/-] [+][FEATURE] Accessibility-tree integration for computer use tools (macOS AX, Linux AT-SPI, Windows UIA)[/+] on Aug 20, 2026
  4. moved this from Todo to Done in 2026on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions