[Bug]: list_windows returns empty titles for windows whose CGWindowList titles are readable
Primary area
Cua Driver
Summary
list_windows on macOS returns title: "" for windows whose titles are plainly readable from CGWindowListCopyWindowInfo in the same TCC context. Agents lose the single most useful disambiguator when picking a window ("which of these six windows is the editor?").
Reproduction
- Have a few normal titled windows on screen (Finder, System Settings, a browser).
{"method":"call","name":"list_windows","args":{"on_screen_only":true}}against the daemon socket.- Compare each
titleagainstkCGWindowNamefrom a directCGWindowListCopyWindowInfocall made by any process with the same Screen Recording attribution.
Expected behavior
title carries the window title whenever kCGWindowName is readable.
Actual behavior
title: "" for those same windows. In our runs: 0.23.2 returned blank titles for 2/2 truth-titled windows; 0.16.0 returned 1/6 correct against 5 truth-titled (so it's long-standing, not a 0.23 regression).
Environment
cua-driver-rs 0.23.2 and 0.16.0 (darwin-arm64 release tarballs), macOS 26.0 (Darwin 27), Apple Silicon. Screen Recording granted via caller attribution — check_permissions reports it true, and window-title reads require that grant, which is why we cross-checked in the same attribution context.
Evidence
Same moment, same machine, three readers:
- A neutral referee CLI reading
CGWindowListCopyWindowInfodirectly: titles present. - A Swift driver mirroring this tree's design, walking the same API: titles match the referee 6/6.
- cua-driver 0.6.0: 5/6 correct. 0.16.0: 1/6. 0.23.2: 0/2.
The window sets agree perfectly across all readers (no missing/phantom windows) — only the title field is dropped.
Workaround and additional context
Callers fall back to get_window_state per window to recover identity, which is exactly the expensive path list_windows exists to avoid. If the blanking is deliberate (privacy posture), the field's presence with an empty value is a confusing way to say so — a documented opt-in/opt-out would be kinder to agents.
🤖 Generated with Claude Code
Looking at preserving readable kCGWindowName values through the existing macOS enumeration path. I will validate it against the direct CoreGraphics result and keep the change scoped to list_windows title reporting.
Sounds exactly right — validating against the direct CoreGraphics result is the same cross-check we used to confirm the bug (our referee read CGWindowListCopyWindowInfo in the same Screen Recording attribution context and saw all titles the driver blanked). Happy to re-run that three-reader comparison against a build of your branch if useful.