Skip to content

fix(desktop): correct display targeting, resilient tree reads, honest failures#23

Merged
sebyx07 merged 1 commit into
mainfrom
fix/desktop-adapter-hardening
Jul 2, 2026
Merged

fix(desktop): correct display targeting, resilient tree reads, honest failures#23
sebyx07 merged 1 commit into
mainfrom
fix/desktop-adapter-hardening

Conversation

@sebyx07

@sebyx07 sebyx07 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Four verified logic bugs in the desktop adapter, found in a systematic review:

  1. Configured X11 display didn't clear inherited WAYLAND_DISPLAY — running the server from a Wayland desktop with display: ':99' (Xvfb) made chooseCaptureTool pick grim and silently screenshot the developer's live desktop while xdotool/AT-SPI drove :99. An explicit display now drops WAYLAND_DISPLAY from the child env.

  2. One Component-less AT-SPI node killed the whole tree read. Application-root accessibles (role application) don't implement org.a11y.atspi.Component; the unconditional GetExtents made busctl exit non-zero → AdapterError → every readState/find/click failed at depth 0. GetExtents failures now fall back to zero bounds; role/name/state stay loud.

  3. activateWindow swallowed every non-ENOENT failure as "window not up yet" — e.g. Can't open display: :99 silently spun the full 10s poll then reported "window not found". Failures carrying stderr now throw immediately with the real cause; empty-stderr non-zero exits (xdotool search's no-match) keep polling.

  4. A managed app that died left a stale #process — later open skipped the respawn (recovery impossible), and close could kill(-pid) a recycled process group. exit/error handlers now clear the handle so open relaunches and close no-ops.

New regression tests for all four; each fails against pre-fix code.

🤖 Generated with Claude Code

…ycle

Four desktop-adapter bugs, each with a regression test:

- proc: an explicit X11 `display` now drops inherited WAYLAND_DISPLAY from
  the child env, so capture dispatches to scrot on the configured display
  instead of grim grabbing the live Wayland desktop.
- atspi: a node without org.a11y.atspi.Component (application roots,
  toolkit fillers) no longer kills the whole tree walk — GetExtents
  failure falls back to zero bounds; role/name/state stay loud.
- input: activateWindow only treats a rejection with EMPTY stderr as
  "no match yet"; real failures (e.g. Can't open display) throw a loud
  AdapterError immediately instead of masking the cause behind a 10s poll.
- adapter: the managed child clears #process on exit/error, so a crashed
  app can be relaunched by a later open and close never kills a recycled
  process group.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2b69752-03c3-4e26-b87d-b6d16f7c81c5

📥 Commits

Reviewing files that changed from the base of the PR and between fcbbf7e and 232fc96.

📒 Files selected for processing (9)
  • src/adapters/desktop/atspi.test.ts
  • src/adapters/desktop/atspi.ts
  • src/adapters/desktop/capture.test.ts
  • src/adapters/desktop/desktop-adapter.test.ts
  • src/adapters/desktop/desktop-adapter.ts
  • src/adapters/desktop/input.test.ts
  • src/adapters/desktop/input.ts
  • src/adapters/desktop/proc.test.ts
  • src/adapters/desktop/proc.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/desktop-adapter-hardening

Comment @coderabbitai help to get the list of available commands.

@sebyx07
sebyx07 merged commit 51b70d6 into main Jul 2, 2026
2 checks passed
@sebyx07
sebyx07 deleted the fix/desktop-adapter-hardening branch July 2, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant