You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c931496
Browse filesBrowse the repository at this point in the historyBrowse files
feat(computer-use): work in Mac app windows in the background (#6606)
* feat(computer-use): work in Mac app windows in the background
Behind the new computerUseBackground feature (off by default), control
sessions on This Mac work in their window where it is: the helper makes it
the app's key window with WindowServer event records instead of raising it
and activating the app, posts pointer and key events to the app's process,
primes Chromium's user-gesture check before a click, and reads the window
without bringing it forward. The person's front app, cursor and Space stay
as they are, so they keep working and several chats work at once.
Background sessions skip the per-computer turn queue, the focus lock and
the typing-gap wait; keys are sent only while the window is the app's key
window and the observed field still has focus. Blender and Unity keep the
foreground path, as does any Mac without the private calls.
Observations in background sessions read the accessibility tree first and
skip the screenshot when it names at least eight controls; include_image
true still asks for one. Every action receipt reports its delivery and
whether the front app, cursor or Space changed, and the real-app check
prints that per scenario.
Signed-off-by: Jalil <reachjalil@gmail.com>
* fix(computer-use): take the front for steps that need it in background sessions
Menu shortcuts, modified clicks, hover, drags and keys to Chromium,
Electron and Catalyst apps do nothing when sent to an app in the
background, so those steps now take the front through the shared-desktop
path; a step whose window had to come forward and that uses coordinates
asks for a fresh look and sends nothing.
Clicks send the app only the focus record; keys add the make-key pair and
read the app's focused window back, retrying once, and a session whose app
never focuses the window takes the front from then on. Hit tests in the
background ask the app, not the screen, what is under the point, so a
covered window can still be clicked. Background sessions launch apps
without activating them, read a background app's focused window, flag a
focused dialog, keep games and Qt, wxWidgets and Tk apps in front, and
the Chromium primer press is no longer tracked or shown.
Signed-off-by: Jalil <reachjalil@gmail.com>
* fix(computer-use): one agent at a time changes an app's key window
An app sends keys to its one key window. Background sessions in different
windows of the same app ran at once, so one could make its window key
between another's check and its keys, and that agent's text landed in the
wrong window.
Every control step that can change the key window (a background focus or
make-key record, or bringing a window forward to open, look, act or
continue) now holds a cross-process lock for the app until its input is
sent. Sessions in different apps still work at the same time; the lock is
taken after the keyboard focus lock, never before.
Signed-off-by: Jalil <reachjalil@gmail.com>
---------
Signed-off-by: Jalil <reachjalil@gmail.com>
0 commit comments