360 Secure SkillHub
360 安全技能中心

agent-desktop-linux

该 Skill 面向 agent-desktop 在 Linux 的部署与排障,说明 AT-SPI 无障碍总线、工具包身份、X11 与 Wayland 差异、截图授权、无头模式限制及对应错误码处理,帮助判断可执行操作并修复常见权限、引用和显示服务器问题。

分类:自动化
vercel-labs
热度 0.00
最近更新 2026-12-03 17:08:43

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add vercel-labs/agent-desktop/agent-desktop-linux
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
agent-desktop-linux
tags
linux-automation, accessibility, at-spi, ai-agent, gui-automation, cli
requirements
["agent-desktop"]
description
Linux setup and troubleshooting for agent-desktop: the AT-SPI bus, toolkit identity, X11 versus Wayland, capture consent, and headless refusals.

agent-desktop on Linux

Use the core skill's headless observe, act, verify workflow. A platform capability never authorizes --headed; only the user's explicit request does.

Setup and permissions

Use an at-spi2-core bridge with fix dc0dc33 before observing applications. Ubuntu 22.04's older bridge can abort the target on Action.GetActions; a reachable bus does not prove it is safe.

Run agent-desktop status as the target's user in the same desktop session. It probes the AT-SPI registry through the session's accessibility bus: permissions.accessibility is granted when the registry answers, even if list-apps is empty. denied with no supported_surfaces means the bus is unavailable, not an empty desktop. Follow the reported setup suggestion. automation is not_required. screen_recording is not_required when the X11 capture probe answers and unknown on Wayland or an unproven display.

There is no accessibility permission dialog. The target must share the bus, including through a sandbox. Restart an app that predates the bus only after preserving its work. Never restart another user's or a shared host's live bus; use a private session and runtime directory for isolated work.

Platform behavior

  • Semantic AT-SPI observation and actions work on X11 and Wayland. A reachable accessibility bus does not establish pointer, window-control, capture, shell, notification, or tray capability.
  • GTK refs can retain native element addresses and ancestry. Chromium, Qt, and unknown-toolkit refs must be unique in the window or inside their nearest unique ancestor. Take fresh refs after list changes; a narrower drill does not disambiguate identical twins.
  • A table reports row_count and column_count, and a large sheet is read by its cells in view. While a window shows a sheet read this way, a ref that carries no native element address is refused: a twin could sit among the cells that were not read. A cell's text is its value. Where a spreadsheet names a cell by its address, get it with find --role cell --name B7 --root '<table ref>'. set-value on an editable cell takes a number; text has no background route and is refused. click and select on a table cell select it where the table supports that; a GTK3 tree view does not.
  • GTK4 list-backed dropdowns stay in the window tree. Use wait --text and snapshot --root to read their contents, not a menu-surface wait. Menu-role popups use the menu surface instead.
  • Popup and dialog openers can take the foreground and refuse headless. Qt combo selection may need pointer input to commit rather than highlight a row. Stop on a headed-only refusal instead of changing mode. Headless restore of a minimized window and headless minimize of the focused window refuse with POLICY_DENIED; the system raises or moves focus.
  • Headless focus-window always returns POLICY_DENIED and sends nothing. A headless focus on a ref that takes key focus also returns POLICY_DENIED. Use --headed focus-window only when the user asks for a visible focus change.
  • A headless graceful close-app of a native Wayland client returns ACTION_NOT_SUPPORTED (details.cause: wayland_session). --force discards unsaved work. When it cannot read the focused window it fails with POLICY_DENIED (details.kind: focus_unreadable) before any close request is sent.
  • press --app works headless only when the target's window is active. Otherwise it sends nothing and returns ACTION_FAILED (details.check: window_active), or STALE_REF when the window has no process identity.
  • A Qt toggle button that offers only the Toggle action (no Press) flips its checked state on a headless check or toggle, but the app may not react as it does to a click (for example, a panel does not open). Verify the app's own result; when only a click opens it, the user must ask for --headed.
  • permissions and the other read-only probes connect to the accessibility bus without announcing a listener, so they never look like an assistive client to Chromium or Electron. A command that reads a tree announces one.
  • On X11 a command that sent keys ends up to 200 ms after its last key, before the accessibility connection closes. The last client leaving mid-key can crash GTK 3, Chromium and Electron apps.
  • A node whose GetActions does not answer within 300 ms is read by index from NActions and GetName, so WebKitGTK and Chromium content stays in the tree. When that also fails, the node keeps its place and its actions field is failed.
  • On X11 a toolkit that draws at a device scale (GTK with GDK_SCALE, a scaled GNOME session) reports window coordinates in logical pixels while the window sits at physical pixels. Bounds, headed clicks and the cursor overlay use physical pixels: the factor is the whole number from 2 to 4 that the window's X client size shows over the size the frame reports, and any other ratio leaves coordinates as read. Fractional scales and popups are not scaled.
  • A GTK4 list or grid view has no row nodes, so select and click cannot pick a row.
  • A headless select on a GTK4 list box is refused with selection_index_unproven: the toolkit gives no promise that its selection indices name the rows it presents, so only --headed on X11 clicks the row.
  • A window can precede its content. Wait for the application's observable result; an accepted AT-SPI call or a changed selected value does not prove that handlers ran. Wait for each effect before another click.
  • With WAYLAND_DISPLAY unset and DISPLAY naming an Xwayland, the window listing classifies frames as on a Wayland session: the display answers the XWAYLAND extension, so native Wayland windows are listed and the compositor frames are not read as X11 windows. An Xwayland that does not answer is read as plain X11.
  • Wayland refuses headed pointer input; window operations can use a mapped Xwayland client, but native Wayland windows lack that route.
  • Authorized physical type sends a newline as Return on X11 too and refuses a tab and other control characters. On Wayland it sends a newline as Return and a tab as Tab, which can submit a form or move focus instead of inserting literal text.
  • Wayland per-window screenshots are unsupported; display capture uses a portal that can ask for consent. Ask the user before a visible consent flow, and do not retry a pending request in a loop. GNOME draws monitors of different scales at the largest scale, so a --screen capture of a lower-scale monitor reports that larger scale in scale_factor. An image whose size fits no layout is PLATFORM_NOT_SUPPORTED with details.reason: "display_mapping". A monitor turned by 90° or 270° reports the turned size, and a transform beyond the eight Wayland defines is PLATFORM_NOT_SUPPORTED with details.reason: "monitor_transform".
  • X11 capture depends on compositing: a covered noncomposited window may have no readable pixels, and a composited desktop may not support whole-screen capture. Neither failure authorizes focusing the target.
  • Shell notifications need the supported GNOME service; tray reads need a StatusNotifierWatcher. A missing service is an error.
  • Password-role values are withheld, but a field that only masks its text can be readable. Treat observation output as sensitive.
  • launch accepts a program on PATH, an absolute path, an installed desktop id, or an unambiguous desktop entry name. A script launch attaches only to the interpreter process that runs that script, never to another script of the same interpreter. --no-attach refuses any running process of the same program (the same executable, or the interpreter running the same script) whatever its arguments. Use process and window identity from observations rather than guessing from a window title. Without --activate, a launch on X11 gives the focus and window order back and reports focus_returned: true, or false with a suggestion; a headless click that opens a dialog is guarded the same way.
  • press escape --app <app> --window-id <id> on a background window with a showing native popup closes it only via a dismissal action (or GTK3 combo box Press) and reports delivered_verified once gone. Web content and buttons without a dismissal action keep the focus refusal; it never collapses a tree row.
  • Sandboxes are not available on Linux yet. To run agent-desktop in a container you manage yourself, see agent-browser.dev/desktop/guides/docker-container.

Troubleshooting

Read the disposition before applying a fix. Match both the code and message.

Code and message pattern Cause and fix
PLATFORM_NOT_SUPPORTED: session bus or accessibility bus unavailable Run in the target's desktop session. Install at-spi2-core if missing and share the accessibility bus with sandboxed targets; do not restart a shared live bus.
APP_NOT_FOUND: running but not on the accessibility bus The process has not registered or its toolkit is inaccessible. Preserve work before restarting; Chromium may need --force-renderer-accessibility, and Qt needs QT_ACCESSIBILITY=1 at launch.
STALE_REF: Stored ref does not match any live element (resolve_no_candidate) The adapter could not land the ref. Take a fresh snapshot in the same session; do not infer delivery from the missing target.
POLICY_DENIED: foreground, popup, dialog, or pointer required The operation cannot run headless. Stop and tell the user which operation needs headed mode; do not add --headed.
ACTION_NOT_SUPPORTED: Wayland pointer input, window operation, or native popup requires input The display server or toolkit cannot provide the route. Use an exposed semantic operation when available, or report the capability limit.
PERM_DENIED or TIMEOUT: screenshot portal consent The portal denied capture or is waiting for the user. Ask the user to handle consent; do not loop or attempt to automate the inaccessible prompt.
PLATFORM_NOT_SUPPORTED: missing clipboard owner helper or wl-clipboard X11 needs the shipped owner helper beside the binary; Wayland needs wl-copy and wl-paste. Repair the installation instead of treating the clipboard as empty.
PERM_DENIED: private file parent is accessible by group or other users The state root is not private. Run chmod 700 "${AGENT_DESKTOP_HOME:-$HOME/.agent-desktop}", or use a new state root and let the tool create it.
PERM_DENIED: private file parent is not owned by the effective user The directory belongs to another user. Point AGENT_DESKTOP_HOME at a new directory under your home and let the tool create it; do not take over someone else's state.