Skip to content

Wayland backend for cua's Linux engine (next after #171's X11 engine) #224

Open

Description

@SSFSKIM

Problem & intent

cua's Linux engine (#171) drives X11 sessions only, as OpenAI's sky_linux (the helper it replaces) does. Mainstream desktops are leaving X11: Plasma 6 made Wayland the default, and GNOME's release team disabled the X11 session by default in the GNOME 49 cycle with removal planned around GNOME 50 (XWayland stays, but it exposes only X11 clients). On a Wayland session the X11 engine sees the XWayland clients and nothing else.

Intent: let cua drive native-Wayland applications, keeping the agent contract cua already offers wherever the platform allows it, and answering plainly where it does not. This is the next ticket after #171 (owner ruling 2026-10-28: the two Wayland items rank above the visible agent cursor and any-character typing).

What #171 leaves in place for this ticket

  • The capabilities wire command (Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171 spec, docs/doperpowers/specs/2026-10-28-own-linux-engine-design.md, "Capability report"): {backend, tree, input: {background, desktop}, capture: {window, desktop}, text: {paste, literal}, desktop: "shared"|"dedicated", version, build}. A Wayland backend answers with its own values (for example capture.window: "portal", input.background: false); cua's service already turns a missing capability into one sentence naming it instead of a failure inside the engine.
  • The AT-SPI tree read. AT-SPI serves Wayland applications too; it grants no capture or input authority.
  • The per-device desktop mode (shared refuses to bring windows forward; dedicated may).

Constraints and known facts (research of 2026-10-28)

  • No silent authority on Wayland. Input goes through the xdg-desktop-portal RemoteDesktop session and ConnectToEIS (libei), capture through ScreenCast and PipeWire; both return file descriptors. First use shows a consent dialog; restore tokens can skip it later, but each is single-use, replaced on every restore, and the backend may prompt again. InputCapture is not an injection route. Portal docs: RemoteDesktop, ScreenCast.
  • A ScreenCast window source has no portable binding to an application or window identity, and its coordinates are logical, not necessarily pixels.
  • EIS emulates devices, so input follows the compositor's pointer and keyboard focus. The X11 engine's background route (events sent to an unfocused window, no focus or stacking change) has no portal equivalent we know of.
  • libei 1.6 (May 2026) added ei_text (keysyms and committed UTF-8), with compositor support still arriving (libei update, July 2026). Negotiate the device capability at runtime; the installed library version proves nothing, least of all on Ubuntu 24.04's older stack.
  • Newton (Wayland-native accessibility) is experimental; do not depend on it.
  • uinput (root) and compositor-private protocols are separate privileged backends, never silent fallbacks.
  • Library rule (owner, 2026-10-28): the crates OpenAI's helper links count as vetted; anything else (zbus, ashpd, pipewire bindings, reis) needs review first.
  • cua takes no code from the vendor or from surveyed projects; behaviour facts only.
  • KDE's August 2026 remote-desktop work targets a stronger unattended single-user story in Plasma 6.8 (KDE update); it is progress in one compositor, not a portable promise.

Success criteria

Open questions

  1. Which sessions first: the person's own GNOME or KDE session, or a dedicated headless Wayland session per agent device (gnome-remote-desktop headless, KDE 6.8 unattended)? The dedicated case may be the only one where agents can work without disturbing a person.
  2. Mixed sessions: route XWayland clients through the X11 backend and native clients through the portal one, behind one engine?
  3. One engine binary with two backends, or a second binary?
  4. Who answers the consent dialog on a remote device, and how a lost grant is reported.

Decision log

Activity

  1. SSFSKIM commented on Oct 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] ready-for-architect: Next after #171; design needed (portal RemoteDesktop/ScreenCast + libei, capability report from #171)

  2. added
    enhancement
    status:ready-for-architect
    priority:P2
    on Oct 28, 2026
  3. added a commit that references this issue on Oct 28, 2026
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

    enhancementpriority:P2status:ready-for-architect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions