Skip to content

fix(computer-server): lazy-load native handlers#1421

Draft
spqw wants to merge 1 commit into
trycua:mainfrom
spqw:spqw/fix-vnc-backend-lazy-handlers
Draft

fix(computer-server): lazy-load native handlers#1421
spqw wants to merge 1 commit into
trycua:mainfrom
spqw:spqw/fix-vnc-backend-lazy-handlers

Conversation

@spqw
Copy link
Copy Markdown

@spqw spqw commented May 1, 2026

Summary

  • Lazy-load native OS handlers only after the backend is selected.
  • Avoid importing macOS native handlers when CUA_BACKEND=vnc / CUA_VNC_HOST is set.
  • Prevent VNC-backed Lume/Tart sessions from triggering native macOS Accessibility/Screen Recording permission prompts unnecessarily.

Motivation

computer_server.handlers.factory imported the native macOS handler at module import time whenever the host OS was Darwin. The macOS handler intentionally probes Accessibility and Screen Recording permissions on import. For Lume VMs configured with the VNC backend, those native handlers are not used, but the import still causes the permission prompt.

This keeps the existing native behavior unchanged while making the VNC backend independent from native macOS handler side effects.

Testing

  • python3 -m py_compile libs/python/computer-server/computer_server/handlers/factory.py
  • Manually reproduced on a Lume Tahoe VM with CUA server configured for VNC backend (CUA_BACKEND=vnc, CUA_VNC_HOST, CUA_VNC_PORT): /status and /cmd screenshot remain functional through the VNC backend.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 1, 2026

@spqw is attempting to deploy a commit to the Cua Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 004b619a-c132-4ffd-b07b-28d9a670952a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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