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
[Bug]: macOS: app with only an alwaysOnTop window is reported as having no window #548
$ agent-desktop list-windows --app Electron
{"version":"2.6","ok":true,"command":"list-windows","data":[]}
$ agent-desktop find --app Electron --surface menu-bar-extras --name <tray item>
{"version":"2.6","ok":false,"command":"find","error":{"code":"WINDOW_NOT_FOUND","message":"Application 'Electron' is running but has no matching window","suggestion":"Wait for the app to present a window, or run 'list-windows --app'.","disposition":{"delivery":"not_delivered","retry":"safe"}}}
Steps to reproduce
Start an Electron app (44.10.0) with one BrowserWindow({ alwaysOnTop: true }) and a Tray.
Run agent-desktop list-windows --app Electron.
Run agent-desktop find --app Electron --surface menu-bar-extras --name <tray item>.
Expected behavior
The window is listed, and the tray item is found.
Actual behavior
list-windows returns [], and find fails with WINDOW_NOT_FOUND. alert and focused fail the same way. After win.setAlwaysOnTop(false), everything works. The window is on screen with kCGWindowLayer 3 (floating level). It looks like the layer != 0 skip in records_from_dictionaries (crates/macos/src/system/window/cg_window.rs) drops it.
macOS Accessibility permission (macOS only)
I have granted Accessibility permission
Logs / additional context
Same kind of thing with a parentless modal NSAlert (layer 8). --surface alert doesn't find it, --surface focused does, and screenshot times out ("window inventory did not stabilize").
changed the title [-]macOS: app with only an alwaysOnTop window is reported as having no window[/-][+][Bug]: macOS: app with only an alwaysOnTop window is reported as having no window[/+]on Nov 4, 2026
From a process that has not yet been granted Documents access, run ls ~/Documents. The call blocks, and macOS shows the alert "" would like to access files in your Documents folder with Don't Allow / Allow buttons.
Run agent-desktop list-windows. The output is identical to a listing taken before the alert appeared; the alert window is not in it.
Where the alert lives: it is owned by /System/Library/CoreServices/UserNotificationCenter.app and sits at kCGWindowLayer 8. Another CGWindowList-based tool (cua-driver) lists it as app_name: UserNotificationCenter, layer: 8. Its AX tree is plain: AXWindow > AXStaticText (message) + AXButton (Help / Don't Allow / Allow). An AXPress on Allow from an Accessibility-trusted process works: the blocked ls returns 0. I reproduced this twice, with Documents and with Downloads.
Why it matters: an agent driving a remote Mac cannot see these prompts through agent-desktop, so it can't answer them. The command that triggered the prompt just hangs until a human clicks. Listing at least the layer-8 alerts owned by UserNotificationCenter (or, more generally, not dropping on-screen windows with layer > 0, as this issue suggests) would let snapshot/click reach them.
Activity
[-]macOS: app with only an alwaysOnTop window is reported as having no window[/-][+][Bug]: macOS: app with only an alwaysOnTop window is reported as having no window[/+]shivanikadirgamarajah commentedon Nov 4, 2026
Hi, I'd like to work on this issue! Please let me know if anyone is already working on this.
zj1123581321 commentedon Nov 10, 2026
Another case that the same
layer != 0filter seems to drop, with a bigger impact for automation: macOS privacy (TCC) consent alerts.Environment: agent-desktop 1.0.2, macOS 26.7.2 (arm64), Accessibility granted.
Repro
ls ~/Documents. The call blocks, and macOS shows the alert "" would like to access files in your Documents folder with Don't Allow / Allow buttons.agent-desktop list-windows. The output is identical to a listing taken before the alert appeared; the alert window is not in it.Where the alert lives: it is owned by
/System/Library/CoreServices/UserNotificationCenter.appand sits atkCGWindowLayer8. Another CGWindowList-based tool (cua-driver) lists it asapp_name: UserNotificationCenter, layer: 8. Its AX tree is plain:AXWindow>AXStaticText(message) +AXButton(Help / Don't Allow / Allow). AnAXPresson Allow from an Accessibility-trusted process works: the blockedlsreturns 0. I reproduced this twice, with Documents and with Downloads.Why it matters: an agent driving a remote Mac cannot see these prompts through agent-desktop, so it can't answer them. The command that triggered the prompt just hangs until a human clicks. Listing at least the layer-8 alerts owned by
UserNotificationCenter(or, more generally, not dropping on-screen windows with layer > 0, as this issue suggests) would letsnapshot/clickreach them.lahfir commentedon Nov 28, 2026
fixed in #702 on main: macOS window inventory now includes on-screen floating windows in layers 1..19. thanks @hiroro-work