fix(computer-server): lazy-load native handlers#1421
Conversation
|
@spqw is attempting to deploy a commit to the Cua Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
CUA_BACKEND=vnc/CUA_VNC_HOSTis set.Motivation
computer_server.handlers.factoryimported 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.pyCUA_BACKEND=vnc,CUA_VNC_HOST,CUA_VNC_PORT):/statusand/cmd screenshotremain functional through the VNC backend.