Skip to content

fix(computer-use): tell Linux users that Hyprland is read-only - #5

Merged
wolfmanfx merged 4 commits into
mainfrom
mme/linux-computer-use
Oct 30, 2026
Merged

wolfmanfx merged 4 commits into
mainfrom
mme/linux-computer-use

Conversation

@mme

@mme mme commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Computer use on Linux told users "Permissions: ready" even where the driver cannot click or type. On Hyprland (Omarchy) it can only look: list windows, take screenshots, read the accessibility tree, and act on an element it has read. Clicking at a point, pressing keys and raising a window are refused. Cua Driver routes that input through a compositor plugin that is experimental and, in the build Omarchy ships, does not deliver input.

This PR makes pi-kit say so instead.

 /computer-use on | status | setup   (Linux)
-  "Permissions: ready."
+  "Hyprland: read-only. pi can see the screen but cannot click or type."

 Settings › Computer use              (Linux)
-  "Linux needs no permissions ... input also needs Cua's cua-hyprland-plugin ..."
+  warning: "On Hyprland, computer use is read-only: pi can see your screen but cannot click or type."

 computer_click / press_key error     (Hyprland)
-  driver text only
+  driver text + "Hyprland: pi cannot click or type here, only look ..."

How it knows: HYPRLAND_INSTANCE_SIGNATURE is set in a Hyprland session. The backend adds hyprland: boolean to the computer-use state on Linux; the Settings page shows the warning when it is true. No plugin detection, no polling.

packages/pi-computer-use/
├── lib/computer-use.mjs       # isHyprland, the read-only notes, linuxInputHelp, explainToolError
└── extensions/computer-use.ts # on/status/setup print the note; tool errors get the hint
apps/backend/src/computer-use/  # state() adds hyprland on Linux
libs/shared/protocol/           # ComputerUseState.hyprland
libs/settings/feature-settings/ # the warning on the Settings page (en, de)

The plugin install steps are only in the package README, marked experimental and untested.

Not changed: the driver still cannot click on Hyprland. That needs Cua to ship a working plugin.

Also in here: libs/shared/protocol/src/score.spec.ts still expected the outside-edits plugin event that the git-snapshots change (9be1e50) removed, which made the check workflow fail on every PR. The spec now matches the code.

And one more CI fix: on the macOS runner, killing a process group after its leader has exited answers EPERM, not ESRCH. The process runner's safety SIGKILL after close threw inside the close handler, the run never resolved, and the verify service's Stop test timed out. EPERM is now treated like ESRCH there.

Evidence

Driven in the rebuilt desktop app on Omarchy (Hyprland 0.56.2, Wayland), scratch data folder, real model.

  • Before: /computer-use status → Permissions: ready. A click → Background delivery is not available: ... no focus-free input backend ... with no explanation. Settings showed only the generic Linux sentence.
    After: /computer-use status → Hyprland: read-only. pi can see the screen but cannot click or type. plus the driver's own session check. The click error ends with Hyprland: pi cannot click or type here, only look (...). Settings shows the read-only warning. Listing windows and screenshots still work (all window titles returned).
  • Tests: pi-computer-use 18 pass, backend computer-use 16 pass, settings-feature-settings 10 pass. check:i18n, lint and Angular formatting clean. OpenAPI contract and generated SDK regenerated.

Merge Danger

Door: two-way

Text and one optional boolean on an existing API response. Revert restores the old wording.

Blast Radius: small

Linux only. macOS and Windows paths are untouched. ComputerUseState.hyprland is optional, so older clients ignore it.

… permissions are ready

On Linux the extension and Settings page now report what the session offers. On
Hyprland without Cua's compositor plugin, Settings, /computer-use and a refused
input say computer use is read-only (pi can look but not click or type) instead
of "Permissions: ready". The backend exposes the Linux readiness in the
computer-use state; the plugin recipe lives in the package README, marked
experimental.
@mme
mme marked this pull request as draft October 30, 2026 11:05
mme added 3 commits October 30, 2026 12:10
No hyprctl call and no polling: the backend only says whether the session is
Hyprland, and Settings, /computer-use and a refused input say computer use is
read-only there.
… removed

The channel and its schema went with 9be1e50; the spec still expected them, so
the check workflow failed on every pull request since.
@mme mme changed the title fix(computer-use): Hyprland is read-only, say so fix(computer-use): tell Linux users that Hyprland is read-only Oct 30, 2026
@mme
mme marked this pull request as ready for review October 30, 2026 12:24
@wolfmanfx wolfmanfx self-assigned this Oct 30, 2026
@wolfmanfx
wolfmanfx requested a balanced review from Copilot October 30, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The status command incorrectly reports native Wayland routes as enabled when explicitly disabled, misleading users diagnosing why native Wayland apps cannot be reached.

1 open issue
What changed in this PR

This PR makes Hyprland’s computer-use input limitations visible in pi-kit’s commands, tool errors, and Settings, without changing driver capabilities.

Changes:

  • Add Hyprland detection, read-only notices, and explanatory hints for refused input.
  • Expose an optional hyprland state field through the backend, API contract, and generated client, with English/German warnings and tests.
  • Remove obsolete outside-edits expectations and a stale documentation reference.
File Description
packages/​pi-computer-use/​README.md Explain Hyprland limitations and experimental plugin setup.
packages/​pi-computer-use/​lib/​computer-use.spec.mjs Test Hyprland notices and input-error hints.
packages/​pi-computer-use/​lib/​computer-use.mjs Add session detection, notices, and error explanations.
packages/​pi-computer-use/​extensions/​computer-use.ts Display Linux session details and Hyprland warnings.
libs/​shared/​protocol/​src/​score.spec.ts Remove obsolete outside-edits assertions.
libs/​shared/​protocol/​src/​computer-use.ts Define the optional hyprland state field.
libs/​shared/​i18n/​src/​lib/​translations/​en.json Add English Hyprland warning text.
libs/​shared/​i18n/​src/​lib/​translations/​de.json Add German Hyprland warning text.
libs/​shared/​api/​src/​generated/​types.gen.ts Include hyprland in generated client types.
libs/​settings/​feature-settings/​src/​lib/​computer-use-section.ts Show a Hyprland warning in Settings.
libs/​settings/​feature-settings/​src/​lib/​computer-use-section.spec.ts Test conditional warning visibility.
doc/​api/​openapi.yaml Expose the optional field in the API contract.
apps/​backend/​src/​score/​score.service.ts Remove a stale event reference from a comment.
apps/​backend/​src/​computer-use/​computer-use.service.ts Report Hyprland session state on Linux.
apps/​backend/​src/​computer-use/​computer-use.service.spec.ts Test platform-specific Hyprland reporting.

Review effort: Balanced

@wolfmanfx
wolfmanfx merged commit d538143 into main Oct 30, 2026
1 of 3 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.

3 participants