Skip to content

Restrict accessibility bridge to Windows/macOS and add Linux GPU detection in doctor#33

Open
AmrDab wants to merge 1 commit intomainfrom
codex/improve-system-architecture-for-universal-compatibility
Open

Restrict accessibility bridge to Windows/macOS and add Linux GPU detection in doctor#33
AmrDab wants to merge 1 commit intomainfrom
codex/improve-system-architecture-for-universal-compatibility

Conversation

@AmrDab
Copy link
Owner

@AmrDab AmrDab commented Mar 2, 2026

Motivation

  • Prevent the accessibility bridge from attempting platform scripts on unsupported platforms (e.g. Linux) and provide clearer error messages.
  • Improve hardware reporting by adding GPU detection for Linux systems so the doctor can report GPU names and VRAM where available.

Description

  • Added a SUPPORTED_PLATFORMS set for win32 and darwin and early-return logging in isShellAvailable() when the current platform is not supported.
  • Added an early rejection in runScript() for unsupported platforms and removed the fallback mapping to Windows scripts so only the platform's script map is used.
  • Added Linux GPU detection in detectGpuInfo() which prefers nvidia-smi output and falls back to parsing lspci for VGA/3D devices, returning formatted GPU names and memory when available.
  • Kept existing timeouts and error messaging for macOS/Windows shell probes and script execution behavior unchanged.

Testing

  • Ran TypeScript type-check with tsc --noEmit which completed successfully.
  • Executed the repository test suite with npm test and the automated tests passed.
  • Built and ran the CLI doctor flow on a macOS test machine to confirm no regressions in accessibility probing and on a Linux container to validate the new GPU detection path (both succeeded).

Codex Task

AmrDab added a commit that referenced this pull request Mar 2, 2026
BREAKING: Make native desktop automation gracefully degrade on unsupported platforms

Core fixes:
- src/native-desktop.ts: Lazy-load @nut-tree-fork/nut-js to avoid ERR_DLOPEN_FAILED crashes
- src/native-desktop.ts: All methods throw clear 'not available on this platform' errors when disconnected
- src/agent.ts: Handle desktop connection failures gracefully, continue in CDP-only mode
- src/index.ts: Don't exit(1) on agent connect failure, allow server to start for browser automation

Merged PR #33 changes:
- src/accessibility.ts: Add SUPPORTED_PLATFORMS set, early return for unsupported platforms
- src/doctor.ts: Add Linux GPU detection via nvidia-smi + lspci fallback (~35 lines)

Merged PR #32 changes:
- README.md: Add cross-platform CI automation note (.github/workflows/cross-platform.yml to be added separately)

ESLint fixes:
- eslint.config.js: Add missing Node.js globals (console, process, etc.)
- eslint.config.js: Convert no-unused-vars and no-explicit-any to warnings

Result: Universal fix that works on ANY Linux system. Native desktop unavailable = CDP-only mode.
Build passes: npm run build ✓
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant