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.
- ui_snapshot → [e3] AXButton "Save" (256,104 70×26)
- ui_action { snapshot_id: "snap-…", ref: "e3", action: "press" }
- → AXPress on e3: ok
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:
- A ref only works with the snapshot it came from. An expired snapshot, one pushed out of the cache, or an unknown ref is refused.
- If the element changed after the snapshot (it vanished, changed role, belongs to another process or left its window), the ref is stale. The tool refuses it and asks for a new snapshot; it never picks a lookalike.
- An action the element does not support is refused before anything happens, with the list of actions it does support.
- A password field's value is never read back, logged or returned.
- The app is not brought to the front unless the caller passes
activate: true. - Only the
ownerprofile can callui_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:
- Read the mouse position.
- Open TextEdit with a new document.
- Call
ui_snapshotand find the text area (AXTextArea) and its ref. - Call
ui_actionwith focus on that ref, then set_value with a sentence. - Call
ui_snapshotagain and check that the text area's value is that sentence. - 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:
screenshot→mouseclick on the text area →keytype →screenshotto check. - B) Tree path:
ui_snapshot→ui_actionfocus →ui_actionset_value →ui_snapshotto check.
A) Screenshot loop
- screenshot → JPEG 1920×1080, ~500 KB
- mouse click on the text area
- key type "The quick brown fox…" (44 keys)
- 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
- ui_snapshot {app: "TextEdit"} → ~2.8 KB text
- ui_action focus → text area
- ui_action set_value "The quick brown fox…"
- 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
| A) Screenshot loop | B) Tree path | |
|---|---|---|
| Tool calls per task | 4 | 4 |
| Time per task, median / p90 | 1.70 s / 1.83 s | 0.36 s / 0.42 s |
| Time per call, median | 333 ms | 101 ms |
| Images returned | 1,001,879 B (2 JPEGs, 1920×1080) | 0 |
| Text returned | 188 B | 5,846 B (2 snapshots, ~2.8 KB each) |
| Est. input tokens, standard model | 3,165 | 1,435 |
| Est. input tokens, high-res model | 5,427 | 1,435 |
| Pointer moved | 10 of 10 runs | 0 of 10 runs |
| Text landed in the document | 10 of 10 | 10 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.