Repository navigation
fix(computer-use): dock annotations, single-resample frames, saner frame retention - #1083
Merged
Merged
Conversation
…ive capture The screen annotator prompt never mentioned the macOS Dock, menu bar, or desktop icons, so annotated frames omitted them and agents could not find Dock apps to click. Frames were also downsampled twice (physical -> logical -> target), losing Retina detail exactly where Dock icons need it; resize once from the native capture instead.
At the 3s capture interval a frame file lived ~15 seconds before the ring buffer removed it - almost always shorter than the LLM round-trip between GetLatestFrame and a follow-up ImageDecode, which then failed with file-not-found. 60 frames keeps ~3 minutes on disk for a few MB.
edenreich
marked this pull request as ready for review
August 19, 2026 23:39
Frames were stretched into the fixed 1024x768 target box, so a 16:10 screen reached the model with a ~15% horizontal distortion. VLM coordinate grounding degrades on distorted images in ways the inverse mapping cannot undo, which showed up as systematic misclicks (Dock icons hit one slot to the left). Per the computer-use guidance, scale with a single uniform factor: FitDims fits the frame inside the target box and both the capture path and the mouse tools derive the API space from it, so the mapping stays symmetric.
Small UI such as Dock icons is unresolvable in the downscaled full frame - annotators confabulate names and coordinates. An optional region argument (frame coordinate space) re-captures just that rectangle at native resolution, annotates it, and translates element coordinates back into the standard frame space, so MouseClick keeps a single coordinate space. Crops above the annotator's image limits are downscaled uniformly; ResizeImage moves to internal/display so both the capture path and the tool share it.
…kens to 4096 Dense annotations (a 30-icon Dock) overflow 1024 tokens, truncating the JSON mid-list; the parser then dropped everything and the model received a raw fenced fragment with zero elements. The parser now recovers the summary and every element object that unmarshals on its own, and the default token budget fits real screens.
edenreich
commented
Aug 20, 2026
Co-authored-by: Eden Reich <[email protected]>
9 tasks
Contributor
|
🎉 This PR is included in version 0.178.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Computer-use agents on macOS could not reliably click small UI like Dock icons. This PR fixes the whole grounding pipeline: frame retention, resampling, aspect-preserving coordinate mapping, OS-chrome annotation, a region zoom for native-resolution inspection, and annotation-parser robustness. Verified end to end: the agent zoomed into the Dock, identified Find My at exact coordinates, clicked it, and the app launched.
Changes
Follow-up: accessibility-tree grounding - #998.