Skip to content

[codex] Sync embedded computer-use-linux v0.2.6 - #424

Merged
ilysenko merged 1 commit into
ilysenko:mainfrom
avifenesh:codex/sync-computer-use-v0.2.6
Jun 6, 2026
Merged

[codex] Sync embedded computer-use-linux v0.2.6#424
ilysenko merged 1 commit into
ilysenko:mainfrom
avifenesh:codex/sync-computer-use-v0.2.6

Conversation

@avifenesh

Copy link
Copy Markdown
Collaborator

Summary

  • Sync the embedded codex-computer-use-linux to the standalone computer-use-linux v0.2.6 screenshot fix.
  • Adds gnome-screenshot as a third capture fallback (chain: GNOME Shell → portal → gnome-screenshot) for background / systemd contexts where the DBus paths are denied.
  • Bumps the embedded crate to 0.2.6-linux-alpha1.

Why

The screenshot tool failed from background processes (systemd user services, non-interactive parent shells) on GNOME Wayland. Both existing backends are structurally unavailable there:

  • GNOME Shell's org.gnome.Shell.Screenshot rejects callers that don't own an allowlisted bus name (DBusSenderChecker) → ACCESS_DENIED.
  • The XDG portal cancels the non-interactive request (response code 2) when there's no foreground window to parent it to.

gnome-screenshot claims an allowlisted bus name and works regardless of session context, so it's the final fallback. Spawned via tokio::process and bounded by a 20s timeout, so a hung capture degrades to a clear error instead of blocking the tool.

Changes

  • gnome-screenshot fallback in capture_screenshot_raw (3-rung chain).
  • CODEX_COMPUTER_USE_SCREENSHOT_BACKEND env var to force a single backend (gnome-shell | portal | gnome-screenshot), skipping the chain — keeps the embedded Codex naming convention.
  • doctor probes gnome-screenshot and lists it under capabilities.screenshot when present.
  • Enables the tokio process feature.

Not included

The upstream mimalloc / release-profile change is intentionally not ported — switching the global allocator is a workspace-wide decision for this repo's maintainer, not something to fold in via a screenshot sync.

Test

  • cargo test -p codex-computer-use-linux → 111 pass (incl. backend-parse + env-override tests); clippy + fmt clean.
  • Upstream fix verified end-to-end via an Xvfb A/B counterfactual: the pre-fix binary errors out with both DBus failures; the post-fix binary falls through and returns a real source: gnome-screenshot capture.

Upstream reference: agent-sh/computer-use-linux v0.2.6 (fixes the background-screenshot issue reported against GNOME Wayland).

Port the upstream computer-use-linux v0.2.6 screenshot fix into the embedded
copy. Screenshots failed from background processes (systemd user services,
non-interactive parent shells) on GNOME Wayland: the GNOME Shell DBus method
rejects callers without an allowlisted bus name, and the XDG portal cancels
non-interactive requests when there is no foreground window.

Adds `gnome-screenshot` as a third capture fallback (GNOME Shell -> portal ->
gnome-screenshot), spawned via tokio::process and bounded by a 20s timeout so
a hung capture degrades to a clear error. `doctor` now probes gnome-screenshot
and lists it under capabilities.screenshot when present.

The backend-force env var keeps the embedded Codex naming:
CODEX_COMPUTER_USE_SCREENSHOT_BACKEND (gnome-shell | portal | gnome-screenshot).

Bumps the embedded crate to 0.2.6-linux-alpha1 to match upstream's 0.2.6
enumeration. Enables the tokio "process" feature. The upstream mimalloc /
release-profile change is intentionally NOT ported — switching the global
allocator is a workspace-wide decision for this repo's maintainer to make.

@avifenesh avifenesh left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an auto review done by revuto.


Found one test-isolation issue that matches the repo's env-mutation guard pattern.

Comment thread computer-use-linux/src/screenshot.rs

@ilysenko ilysenko left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head. The screenshot fallback chain remains fail-soft, gnome-screenshot is only a final fallback or explicit override, diagnostics/tests are aligned, and local cargo test/fmt/clippy passed.

@ilysenko
ilysenko merged commit 21cd3b8 into ilysenko:main Jun 6, 2026
5 checks passed
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.

2 participants