pub(crate) fn enumerate_agentmux_windows() -> Result<Vec<AgentMuxWindowInfo>>Expand description
Enumerate every top-level OS window, AgentMux-owned or not, each tagged
with the CaptureTier that decides whether it may be captured.
is_agentmux is matched via app_name(), not title() — AgentMux’s own
process names are version-stamped, e.g. agentmux-0.55.18, not a single
fixed string, but they all share the agentmux prefix (reagent P1, PR
#2709 round 2). That flag no longer decides inclusion — non-AgentMux
windows are T4 capture targets — but it still gates disclosure: they stay
out of DiscoverWindows’ default listing and their titles are withheld
from candidate/miss lists (candidate_label), which is what keeps round
2’s KeePass-title leak closed now that they’re enumerated at all.
is_self marks windows belonging to the calling agent’s OWN instance
(own_instance_pids()).
Historical note (reagent P2 on PR #2845): this comment previously said
is_self windows were “hard-excluded downstream by capture_window_impl
… the actual isolation boundary, not a nicety” (reagent P0, PR #2709
round 3). That is no longer true and the reasoning has been superseded, not
merely relaxed: the boundary it protected —
SPEC_AGENT_UI_AUTOMATION_CLICK_SCREENSHOT_2026_08_18.md §6’s own-pane-only
default — was an unratified recommendation that defaulted closed because no
mechanism existed to be selective. is_self now resolves to
CaptureTier::SameInstance, which is allowed. See
SPEC_AGENT_UNRESTRICTED_CAPTURE_WITH_ACCOUNTABILITY_2026_08_30.md.