Conversation
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.
What this enables
The desktop agent can use a local Cua-S1 4B model to choose a click target from the current window's screenshot. This supports controls that have no accessibility element.
The task defines named candidate points with
--pixel-target. The model receives the screenshot and selects one of those points. Each click carries the window target and capture ID, so the driver can reject stale captures and invalid coordinates.The optional
cua-four-bextra supports the text and multimodal adapters through the existing decision-model interface.CUA_S1_VARIANT=4bselects it; Nano remains the default for--model cua. Screenshot bytes are passed separately from the serialized observation state.Implements RFC #30. Related features: #14 and #15.
macOS results
Tested on macOS 26.2 arm64 with Cua Driver 0.30.1. The native app draws Save and Cancel without accessibility children and swaps their positions on reset.
The model selected right, left, right, left as Save moved. All four selections were checked against the app's output file. Median model decision time was 7.369 s. Episode times exclude model loading; the model run used no fixed plan or hosted model API calls.
An intentionally wrong-point check was rejected and recorded Cancel in the output file.
Tests
Added
tests/test_decision_models_cua_four_b.pyandtests/test_desktop_visual.py, and extended the model factory tests. Coverage includes option mapping, invalid model outputs, image delivery, temporary-image cleanup, capture-bound clicks, dry runs, window selection, and separate driver sessions.Core + dev suite: 507 passed, 41 skipped. Ruff, ty, lock check, package build, shell syntax, and CLI/MCP smoke passed.
How to run
Requires macOS,
uv, Swift command-line tools, and Cua Driver with Accessibility and Screen Recording permissions. Keep the Mac unlocked and close any older S1A visual fixture. Run from the current project directory:The base model and adapter download on first use.
CUA_S1_BASE_MODELandCUA_S1_CHECKPOINTcan point to downloaded model directories.