Skip to content

fix(computer_use): Linux multi-monitor X11 AgentCursorOverlay can steal all desktop clicks (MCP path skips --no-overlay) #81220

Description

@pinheij

Bug Description

On Linux X11 multi-monitor desktops, the cua-driver window Cua.AgentCursorOverlay.default can map as a full virtual-desktop override-redirect InputOutput surface (here 6000x1600+0+0) and intercept all clicks outside Hermes. User symptom: "no other item are clickable and I cant use any other apps." Hermes chat can still accept input, so it looks like a total desktop lockout.

This is related to but not the same as #78599 (embedded unrestricted serve missing --no-overlay). This report covers:

  1. User-registered MCP cua-driver with args: [mcp] never receives Hermes overlay policy.
  2. Desktop Linux auto-detect leaves computer_use.no_overlay off (_cua_no_overlay() → False when DISPLAY is set).
  3. Multi-monitor virtual desktop + InputOutput override-redirect overlay = click sink across all heads.
  4. Recovery works via set_agent_cursor_enabled(session, false); teardown/interrupt should not leave the overlay mapped.

Steps to Reproduce

  1. Ubuntu 24.04 GNOME on X11, two monitors (laptop + ultrawide), virtual size spans both.
  2. Hermes Desktop ≥ v0.20.0 with cua-driver 0.18.0.
  3. In ~/.hermes/config.yaml, enable MCP server:
    mcp_servers:
      cua-driver:
        command: /path/to/cua-driver
        args: [mcp]   # no --no-overlay
        enabled: true
  4. Leave computer_use.no_overlay unset.
  5. In a Desktop chat, run several computer_use captures (list_windows, capture on Hermes / screen). Optionally interrupt a long turn.
  6. Observe:
    xwininfo -root -tree | rg AgentCursor
    # Cua.AgentCursorOverlay.default  6000x1600+0+0  Override Redirect yes  InputOutput
  7. Clicks miss other apps; Super/Alt-Tab may feel broken depending on grab.

Expected Behavior

  • Hermes overlay policy applies to every cua-driver launch path it owns or documents (built-in backend, embedded serve, MCP registration).
  • Agent cursor never becomes a full-virtual-desktop click-blocking InputOutput window.
  • Session end / turn interrupt / gateway restart unmaps the overlay without a manual MCP call.
  • get_agent_cursor_state accepts position: null so stuck-overlay diagnosis works.

Actual Behavior

  • Overlay mapped full virtual desktop, override-redirect, InputOutput.
  • Other apps unreachable by pointer until:
    set_agent_cursor_enabled(session="default", enabled=false)
    
  • Live process: cua-driver mcp without --no-overlay under mcp_stdio_watchdog.py.
  • _cua_no_overlay() resolved False on this desktop Linux install; driver does support --no-overlay.

Environment

  • OS: Ubuntu 24.04.4 LTS, kernel 7.0.0-28-generic, X11, GNOME Shell 46.0
  • Monitors: eDP-1 2560x1600+0+0 + HDMI 3440x1440+2560+0 → 6000x1600 virtual
  • Hermes Agent: v0.20.0 (2026.8.3), commit 0957277f2f
  • Desktop UI: v0.20.0 (+171)
  • cua-driver: 0.18.0
  • Python: 3.11.15
  • hermes computer-use doctor: green (not a permissions/capture failure)

Error Output

# During incident
0x3e00001 "Cua.AgentCursorOverlay.default"  6000x1600+0+0
  Map State: IsViewable
  Override Redirect State: yes
  Class: InputOutput

# Policy probe
_cua_no_overlay() → False
_cua_driver_supports_no_overlay() → True

# Secondary diagnostic bug
get_agent_cursor_state: Invalid structured content — position None is not of type 'object'

Additional Context

Related

Local mitigations that worked for reporter

# mcp_servers.cua-driver.args
- mcp
- --no-overlay

computer_use:
  no_overlay: true

(Restart gateway/desktop so MCP args reload.)

Proposed fix directions

  1. When normalizing/starting configured MCP servers named cua-driver (or matching the computer-use driver binary), apply _mcp_args_with_overlay_flag() (or equivalent) so user MCP registration cannot silently drop policy.
  2. Prefer no_overlay auto true on multi-head Linux, or make doctor warn when overlay is enabled with >1 monitor / large virtual root.
  3. Ensure end_session / watchdog death / turn interrupt always unmaps Cua.AgentCursorOverlay.*.
  4. Loosen get_agent_cursor_state schema for null position.
  5. Document emergency recovery: MCP disable cursor, or kill cua-driver mcp child.

Happy to attach more logs from ~/.hermes/logs/ if useful. Session id on reporter machine: 20260807_094641_13df90.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/toolsTool registry, model_tools, toolsetssweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradestool/mcpMCP client and OAuthtype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions