From 874badae69119b6df09ad249971a4517b89e1e9d Mon Sep 17 00:00:00 2001
From: liyikradlee <190435513+liyikradlee@users.noreply.github.com>
Date: Sun, 12 Apr 2026 14:05:19 +0800
Subject: [PATCH 1/3] Fix macOS dependency conflict
---
openspace/local_server/README.md | 8 +++++++-
openspace/local_server/platform_adapters/macos_adapter.py | 5 +++--
openspace/local_server/requirements.txt | 5 +++--
pyproject.toml | 1 -
requirements.txt | 3 ++-
5 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/openspace/local_server/README.md b/openspace/local_server/README.md
index 0e0f8d4..ca69ae2 100644
--- a/openspace/local_server/README.md
+++ b/openspace/local_server/README.md
@@ -37,9 +37,15 @@ Set `"mode": "server"` in `openspace/config/config_grounding.json`:
macOS
```bash
-pip install pyobjc-core pyobjc-framework-cocoa pyobjc-framework-quartz atomacos
+pip install pyobjc-core pyobjc-framework-cocoa pyobjc-framework-quartz
```
+`atomacos` is not included in the default macOS dependency set right now because
+its published releases require `pyautogui<0.9.42`, which conflicts with
+OpenSpace's `pyautogui>=0.9.54`. OpenSpace will still run without it, but the
+macOS accessibility-tree features will stay unavailable until that upstream
+constraint is resolved.
+
**Permissions required** (macOS will prompt automatically on first run):
- **Accessibility** (for GUI control)
- **Screen Recording** (for screenshots and video capture)
diff --git a/openspace/local_server/platform_adapters/macos_adapter.py b/openspace/local_server/platform_adapters/macos_adapter.py
index db7d5f6..00d8028 100644
--- a/openspace/local_server/platform_adapters/macos_adapter.py
+++ b/openspace/local_server/platform_adapters/macos_adapter.py
@@ -20,7 +20,8 @@ class MacOSAdapter:
global _warning_shown
if not MACOS_LIBS_AVAILABLE and not _warning_shown:
logger.warning("macOS libraries are not fully installed, some features may not be available")
- logger.info("To install missing libraries, run: pip install pyobjc-framework-Cocoa atomacos")
+ logger.info("To install missing libraries, run: pip install pyobjc-core pyobjc-framework-Cocoa pyobjc-framework-quartz")
+ logger.info("Note: atomacos is currently optional because its published versions conflict with pyautogui>=0.9.54")
_warning_shown = True
self.available = MACOS_LIBS_AVAILABLE
@@ -719,4 +720,4 @@ class MacOSAdapter:
except Exception as e:
logger.error(f"Failed to get terminal output: {e}")
- return None
\ No newline at end of file
+ return None
diff --git a/openspace/local_server/requirements.txt b/openspace/local_server/requirements.txt
index 5d67d69..e03319a 100644
--- a/openspace/local_server/requirements.txt
+++ b/openspace/local_server/requirements.txt
@@ -8,7 +8,8 @@ requests>=2.32.0
# pyobjc-core>=12.0; sys_platform == 'darwin'
# pyobjc-framework-cocoa>=12.0; sys_platform == 'darwin'
# pyobjc-framework-quartz>=12.0; sys_platform == 'darwin'
-# atomacos>=3.2.0; sys_platform == 'darwin'
+# atomacos is intentionally excluded for now: atomacos 3.2+/3.3 requires
+# pyautogui<0.9.42, which conflicts with OpenSpace's pyautogui>=0.9.54.
# # Linux-specific dependencies (local server)
# python-xlib>=0.33; sys_platform == 'linux'
@@ -18,4 +19,4 @@ requests>=2.32.0
# # Windows-specific dependencies (local server)
# pywinauto>=0.6.8; sys_platform == 'win32'
# pywin32>=306; sys_platform == 'win32'
-# PyGetWindow>=0.0.9; sys_platform == 'win32'
\ No newline at end of file
+# PyGetWindow>=0.0.9; sys_platform == 'win32'
diff --git a/pyproject.toml b/pyproject.toml
index 06c199c..7e4a632 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -34,7 +34,6 @@ macos = [
"pyobjc-core>=12.0",
"pyobjc-framework-cocoa>=12.0",
"pyobjc-framework-quartz>=12.0",
- "atomacos>=3.2.0",
]
linux = [
diff --git a/requirements.txt b/requirements.txt
index 6371308..a925686 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,7 +19,8 @@ requests>=2.32.0
# pyobjc-core>=12.0; sys_platform == 'darwin'
# pyobjc-framework-cocoa>=12.0; sys_platform == 'darwin'
# pyobjc-framework-quartz>=12.0; sys_platform == 'darwin'
-# atomacos>=3.2.0; sys_platform == 'darwin'
+# atomacos is intentionally excluded for now: atomacos 3.2+/3.3 requires
+# pyautogui<0.9.42, which conflicts with OpenSpace's pyautogui>=0.9.54.
# # Linux-specific dependencies (local server)
# python-xlib>=0.33; sys_platform == 'linux'
From 22d6864df2024806c6e9895462ad9279e21d1599 Mon Sep 17 00:00:00 2001
From: liyikradlee <190435513+liyikradlee@users.noreply.github.com>
Date: Sun, 12 Apr 2026 14:13:01 +0800
Subject: [PATCH 2/3] Ignore local virtualenv
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 77dd181..d5419df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ Desktop.ini
.vscode/
.idea/
.pytest_cache/
+.venv/
# Distribution / packaging
dist/
From 59095d52c2897e9535769e1ac3c71e915ff6f3f7 Mon Sep 17 00:00:00 2001
From: xlrrrr
Date: Thu, 16 Apr 2026 20:31:26 +0800
Subject: [PATCH 3/3] fix: separate atomacos import from AppKit to avoid
disabling all macOS features
The original change removed atomacos from dependencies but left it
bundled in the same try/except as AppKit. Without atomacos installed,
the ImportError made MACOS_LIBS_AVAILABLE=False, silently disabling
every macOS feature (screenshots, window control, etc.) even though
they never use atomacos.
- Split import into independent try/except blocks
- Guard get_accessibility_tree() with ATOMACOS_AVAILABLE
- Condense redundant comments in requirements files
- Tighten README note into a blockquote
---
openspace/local_server/README.md | 6 +-----
.../local_server/platform_adapters/macos_adapter.py | 13 ++++++++++---
openspace/local_server/requirements.txt | 3 +--
requirements.txt | 3 +--
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/openspace/local_server/README.md b/openspace/local_server/README.md
index ca69ae2..d31524c 100644
--- a/openspace/local_server/README.md
+++ b/openspace/local_server/README.md
@@ -40,11 +40,7 @@ Set `"mode": "server"` in `openspace/config/config_grounding.json`:
pip install pyobjc-core pyobjc-framework-cocoa pyobjc-framework-quartz
```
-`atomacos` is not included in the default macOS dependency set right now because
-its published releases require `pyautogui<0.9.42`, which conflicts with
-OpenSpace's `pyautogui>=0.9.54`. OpenSpace will still run without it, but the
-macOS accessibility-tree features will stay unavailable until that upstream
-constraint is resolved.
+> **Note:** `atomacos` is excluded because it requires `pyautogui<0.9.42` (appears unmaintained). Accessibility-tree features are currently unavailable.
**Permissions required** (macOS will prompt automatically on first run):
- **Accessibility** (for GUI control)
diff --git a/openspace/local_server/platform_adapters/macos_adapter.py b/openspace/local_server/platform_adapters/macos_adapter.py
index 00d8028..0dbaf6d 100644
--- a/openspace/local_server/platform_adapters/macos_adapter.py
+++ b/openspace/local_server/platform_adapters/macos_adapter.py
@@ -5,11 +5,16 @@ from openspace.utils.logging import Logger
try:
import AppKit
- import atomacos
MACOS_LIBS_AVAILABLE = True
except ImportError:
MACOS_LIBS_AVAILABLE = False
+try:
+ import atomacos
+ ATOMACOS_AVAILABLE = True
+except ImportError:
+ ATOMACOS_AVAILABLE = False
+
logger = Logger.get_logger(__name__)
_warning_shown = False
@@ -21,8 +26,9 @@ class MacOSAdapter:
if not MACOS_LIBS_AVAILABLE and not _warning_shown:
logger.warning("macOS libraries are not fully installed, some features may not be available")
logger.info("To install missing libraries, run: pip install pyobjc-core pyobjc-framework-Cocoa pyobjc-framework-quartz")
- logger.info("Note: atomacos is currently optional because its published versions conflict with pyautogui>=0.9.54")
_warning_shown = True
+ if not ATOMACOS_AVAILABLE:
+ logger.debug("atomacos not installed; accessibility-tree features unavailable (conflicts with pyautogui>=0.9.54)")
self.available = MACOS_LIBS_AVAILABLE
def capture_screenshot_with_cursor(self, output_path: str) -> bool:
@@ -164,6 +170,8 @@ class MacOSAdapter:
"""
if not MACOS_LIBS_AVAILABLE:
return {'error': 'macOS accessibility libraries not available'}
+ if not ATOMACOS_AVAILABLE:
+ return {'error': 'atomacos is not installed; accessibility-tree features require it'}
try:
# Get frontmost application
@@ -178,7 +186,6 @@ class MacOSAdapter:
logger.info(f"Getting accessibility tree: {app_name} ({bundle_id})")
- # Use atomacos to get application reference
try:
if bundle_id:
app_ref = atomacos.getAppRefByBundleId(bundle_id)
diff --git a/openspace/local_server/requirements.txt b/openspace/local_server/requirements.txt
index e03319a..f73aeda 100644
--- a/openspace/local_server/requirements.txt
+++ b/openspace/local_server/requirements.txt
@@ -8,8 +8,7 @@ requests>=2.32.0
# pyobjc-core>=12.0; sys_platform == 'darwin'
# pyobjc-framework-cocoa>=12.0; sys_platform == 'darwin'
# pyobjc-framework-quartz>=12.0; sys_platform == 'darwin'
-# atomacos is intentionally excluded for now: atomacos 3.2+/3.3 requires
-# pyautogui<0.9.42, which conflicts with OpenSpace's pyautogui>=0.9.54.
+# atomacos excluded: requires pyautogui<0.9.42, conflicts with >=0.9.54
# # Linux-specific dependencies (local server)
# python-xlib>=0.33; sys_platform == 'linux'
diff --git a/requirements.txt b/requirements.txt
index a925686..c53814c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,8 +19,7 @@ requests>=2.32.0
# pyobjc-core>=12.0; sys_platform == 'darwin'
# pyobjc-framework-cocoa>=12.0; sys_platform == 'darwin'
# pyobjc-framework-quartz>=12.0; sys_platform == 'darwin'
-# atomacos is intentionally excluded for now: atomacos 3.2+/3.3 requires
-# pyautogui<0.9.42, which conflicts with OpenSpace's pyautogui>=0.9.54.
+# atomacos excluded: requires pyautogui<0.9.42, conflicts with >=0.9.54
# # Linux-specific dependencies (local server)
# python-xlib>=0.33; sys_platform == 'linux'