跳转到内容

Agent e2e verification — Wayland, browser, computer-use

Agent e2e verification — Wayland, browser, computer-use

Section titled “Agent e2e verification — Wayland, browser, computer-use”

Related: Cloud agent orchestrator · 2026-09-28 Pi SDK sessions worktrees and TS coordinator


Default: headless sway + grim (screenshot) + wtype (keys) + wlrctl (pointer). Optional wayvnc (human peek), cage (single-app kiosk).

Terminal window
WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 sway -c minimal.conf &
# discover WAYLAND_DISPLAY — do not hardcode wayland-1
WAYLAND_DISPLAY=… grim /tmp/shot.png
WAYLAND_DISPLAY=… wtype "…" # or wlrctl pointer move|click
HostVerdict
swayDefault — headless + IPC + grim/wtype proven
labwcGood alt; LABWC_FALLBACK_OUTPUT=NOOP-fallback; often wayland-0
cageSingle-app isolation; watch headless virtual-pointer timing
westonFine nested/CI (-Bheadless / -Bvnc); not wayvnc-compatible
mutter / gnome-kioskGNOME fidelity only; heavy D-Bus — optional profile
gamescopeSkip unless gaming DUT
wayvncwlroots-only RFB; not GNOME/KDE/Weston

  1. L1 — Playwright chromium-headless-shell (nixpkgs playwright-driver) for deterministic flows.
  2. L2 — browser-use / Stagehand as skills over the same CDP session.
  3. L3 — Anthropic computer-use toolset executor against Wayland (or Xvfb); OpenAI CUA as optional skill.
  4. Cursor-style computerUse — same plane: PNG → multimodal → wtype/wlrctl (not ydotool/uinput).

Capture: grim for screenshots; wf-recorder for traces; skip scrot (X11). Prefer grim over portal on wlroots headless.


ConcernIn-coreNix host flakeSkills
Session lifecyclespawn/teardown, discover display, stale-socket cleanupsway/labwc/cage—
Action APIscreenshot / click / type / key / scroll; ordered batches; halt-on-failgrim, wtype, wlrctl—
Coord scalingmodel pixels ↔ capture; image limits—model resize hints
Model adaptersAnthropic/OpenAI tool_result shaping—prompts, confirm policy
Browserthin CDP/Playwright connect + artifactsplaywright headless-shell onlybrowser-use, Stagehand
Observabilitystep log + PNG/WebM under run idwf-recorder, ffmpegexporters
Remote peekoptional RFB metadatawayvnc—
Domain e2eassertion hooks—app/site evals

Rule: Core = contract. Host = binaries. Skills = LLM exploration + domain. Keep full Chromium / browser-use out of the default core closure (~400–650 MB headless-shell vs ~2.2 GB full set).


  1. Stale wayland-* sockets after hard kill — discover or clean every run.
  2. Headless = pixman; need a DRM profile for GL/Vulkan DUTs.
  3. wayvnc frames stall if the nested window is covered.
  4. cage pointer race: create virtual pointer → settle → click.
  5. Classic computer-use bug: downscale screenshot without inverse-scaling clicks.
  6. Playwright/Nix skew — flake-pin playwright, never npx.
  7. Prompt injection — vault creds server-side; human confirm for irreversible acts.
  8. Pure vision loops are expensive — freeze L1 for ~10–30% of LLM steps.

  1. Flake: sway / grim / wtype / wlrctl + core session supervisor
  2. Core computer-use executor (Anthropic toolset shape)
  3. Flake: playwright headless-shell + L1 harness
  4. Optional: wayvnc, wf-recorder, cage
  5. Skills: browser-use / Stagehand; mutter only if DUT needs GNOME