← Dev notes

OpenAB Computer 0.10.0 now supports full accessibility-tree actions: 4.7× faster and 55% fewer tokens in our test

Results from one TextEdit task done two ways, 10 runs each, on an M4 Mac mini.

The previous dev note introduced ui_snapshot. That was phase 1, in OpenAB Computer 0.9.0: an agent could read a Mac app's accessibility tree, but it could not act on it. OpenAB Computer 0.10.0 adds ui_action, which acts on the tree. Given a snapshot_id and a ref from a snapshot, it can press, set_value, focus, show_menu, confirm or cancel, and the cursor does not move.

UntitledSave changes?CancelSavecursormouse before: (40, 160)mouse after: (40, 160), same point
  1. ui_snapshot → [e3] AXButton "Save" (256,104 70×26)
  2. ui_action { snapshot_id: "snap-…", ref: "e3", action: "press" }
  3. → AXPress on e3: ok
Animation: a made-up dialog. The agent takes a snapshot and finds the Save button as ref e3. It reads the mouse location, calls ui_action with the snapshot id, ref e3 and press, and the button is pressed through the accessibility API. Then it reads the mouse location again: the same point, because the cursor never moved.

So how do we test the whole operation, from reading the tree to acting on it and checking the result?

How we test it

Unit tests with a fake accessibility provider

CI machines have no screen, so the unit tests never touch a real app. They run against a fake accessibility provider that stands in for windows, buttons and text fields, and they check each rule of ui_action:

PR #96 added 52 of these tests. On an M4 Mac mini the full swift test run passed 256 tests with 0 failures, and every CI check on the PR passed.

A live end-to-end run on an M4 Mac mini

Unit tests show the rules are right. The live run shows the whole thing works on a real app. An agent drove an M4 Mac mini through the switchboard, over the same network path a remote agent uses:

  1. Read the mouse position.
  2. Open TextEdit with a new document.
  3. Call ui_snapshot and find the text area (AXTextArea) and its ref.
  4. Call ui_action with focus on that ref, then set_value with a sentence.
  5. Call ui_snapshot again and check that the text area's value is that sentence.
  6. Read the mouse position again and compare.

Both readings were the same point: the text went in, and the cursor did not move. The performance run below repeated the tree steps 10 more times, and each time the text landed and the pointer stayed put.

Every change is also reviewed by two independent AI reviewers running different models, and it merges only when both approve the same commit.

How much faster it is

We timed one task done two ways, 10 times each: type The quick brown fox jumps over the lazy dog. (44 characters) into a new, empty TextEdit document and confirm it.

A) Screenshot loop

  1. screenshot → JPEG 1920×1080, ~500 KB
  2. mouse click on the text area
  3. key type "The quick brown fox…" (44 keys)
  4. screenshot → check the text
tool calls
1234
time
0.33 s0.44 s1.32 s1.70 s
returned to the agent
500 KB500 KB500 KB1.0 MB
est. input tokens
1,5781,5821,5883,165
pointer
not movedmovedmovedmoved

B) Tree path

  1. ui_snapshot {app: "TextEdit"} → ~2.8 KB text
  2. ui_action focus → text area
  3. ui_action set_value "The quick brown fox…"
  4. ui_snapshot → value confirmed
tool calls
1234
time
0.10 s0.17 s0.24 s0.36 s
returned to the agent
2.8 KB2.9 KB3.0 KB5.8 KB
est. input tokens
6857097381,435
pointer
not movednot movednot movednot moved
Animation: the same task done two ways, typing a sentence into a new TextEdit document and checking it. Both sides make four tool calls; the counters add up each call. A, the screenshot loop, ends at 1.70 s, 1.0 MB of images and about 3,165 input tokens (5,427 on a high-resolution model), and the pointer moves. B, the tree path, ends at 0.36 s, 5.8 KB of text and about 1,435 tokens, and the pointer stays put. Medians of 10 runs each on an M4 Mac mini through the switchboard.
Measured: 10 runs per approach, one TextEdit task
A) Screenshot loopB) Tree path
Tool calls per task44
Time per task, median / p901.70 s / 1.83 s0.36 s / 0.42 s
Time per call, median333 ms101 ms
Images returned1,001,879 B (2 JPEGs, 1920×1080)0
Text returned188 B5,846 B (2 snapshots, ~2.8 KB each)
Est. input tokens, standard model3,1651,435
Est. input tokens, high-res model5,4271,435
Pointer moved10 of 10 runs0 of 10 runs
Text landed in the document10 of 1010 of 10

On this task, B used about 55% fewer input tokens than A on a standard model (1,435 vs 3,165) and about 74% fewer on a high-resolution model (1,435 vs 5,427). It finished in 0.36 s against 1.70 s, about 4.7× faster, and the pointer never moved.

Most of A's time goes to typing 44 keystrokes (877 ms) and to the two screenshots, about 500 KB each, coming back through the switchboard. Each ui_action call took about 67 ms end to end, mostly the network round trip.

How tokens were counted: images with the formula in Anthropic's vision guide. The image is shrunk to the model's limits, then costs ⌈width/28⌉ × ⌈height/28⌉ tokens. A standard model (1,568 px long edge) shrinks a 1920×1080 screenshot to 1456×819, about 1,560 tokens; a high-resolution model (2,576 px) keeps it at 1920×1080, about 2,691 tokens. Text at about 4 characters per token; no tokenizer was run. Only what the model would see is counted, not tool definitions or the model's own output.

Conditions: an M4 Mac mini (16 GB, macOS 15.7) with one 1920×1080 display, running OpenAB Computer 0.10.0. The agent reached it over HTTPS on the tailnet through the switchboard, so every call pays that round trip. 10 runs per approach, alternating A and B, after one discarded warm-up pair. Only the four tool calls are timed. A clicked at a point taken from the known window position; a real model would read it off the first screenshot. These numbers come from one machine and one task, and they leave out the time a model spends reasoning about each screenshot or snapshot.

Next

Linux (AT-SPI) support for ui_snapshot and ui_action is deferred as p3 in issue #102. For custom-drawn UI with no accessibility node, screenshot and mouse are still there.

Previous note: OpenAB Computer can now read the macOS accessibility tree.