Skip to content

Add Linux (Ubuntu) build, test, and CLI support - #3

Open
devin-ai-integration[bot] wants to merge 7 commits into
mainfrom
devin/1784740678-linux-support
Open

Add Linux (Ubuntu) build, test, and CLI support#3
devin-ai-integration[bot] wants to merge 7 commits into
mainfrom
devin/1784740678-linux-support

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 22, 2026

Copy link
Copy Markdown

What changed

Makes the package compile, run its full unit test suite, and pass deterministic preflight on Ubuntu (Swift 6.0.3), and adds an ubuntu-latest CI lane. The macOS interaction engine is unchanged; Linux is a protocol/tool-layer port:

  • All Apple-framework code (AppKit, ApplicationServices, CoreGraphics, ScreenCaptureKit, Carbon, IOKit, Quartz) is gated with #if os(macOS) / conditional imports; macOS code paths are syntactically unchanged.
  • New LinuxSupport.swift provides inert type/constant shims (AXUIElement, CGEvent, AX constants, virtual key codes) so shared code compiles; new LinuxStubs.swift reimplements the platform API surface — portable logic (keymap parsing, delivery-fallback reasoning, unicode typing chunks, page-probe JSON parsing) works for real, while anything requiring AX/input/capture throws a structured ToolError.failed("... unsupported on Linux.") rather than fabricating success (including deliverClick/deliverScroll/deliverDrag, which fail loudly on Linux).
  • Daemon works on Linux: Glibc vs Darwin socket branches (sockaddr_un/AF_UNIX type differences), Linux auth-token generation, and peer authentication via getsockopt(SO_PEERCRED) (macOS keeps getpeereid); verified with a daemon round trip on Ubuntu.
  • health_report --json on Linux reports platform identity with Accessibility/Screen Recording as unsupported, capture skipped, TCC not applicable; list_apps returns an empty controllable-app list.
  • Linux withTimeout uses an actor-guarded continuation race so an uncancellable wedged operation cannot block timeout return (this was hanging swift test).
  • ComputerUseFixture (AppKit/SwiftUI) is gated to macOS with a stub Linux main.
  • CI: new linux-build-and-test job (ubuntu-latest, swift-actions/setup-swift@v2 pinned to 6.0.3, SwiftPM cache) running scripts/preflight.py; existing macOS lane untouched. README updated with the Linux support boundary.

Type of change

  • New feature / capability
  • Bug fix
  • Docs only
  • Refactor / internal (no behavior change)
  • Safety-policy change

Verification

All run on Ubuntu 22.04, Swift 6.0.3 (x86_64-unknown-linux-gnu); macOS lane verified via hosted CI (green):

  • swift build — Build complete
  • swift test — 398 tests passed
  • CLI smoke: version, help, health_report --json — all pass; health report correctly shows Linux unsupported capabilities
  • python3 scripts/preflight.py --bin .build/debug/computer-use-mcp — passed (incl. Python helper tests, version consistency, background-eval dry run)
  • MCP serve over stdio: initialize, tools/list (30-tool catalog), tools/call — AX/input/capture tools return structured unsupported errors, no crashes/fake success
  • Linux daemon round trip: call health_report '{}' routes through the daemon; peer auth accepts same-uid clients via SO_PEERCRED
  • Local live verification: not applicable — no macOS runtime behavior changed and no macOS machine available; live Linux interaction is intentionally unimplemented (tools return structured unsupported errors).

Checklist

  • One logical change; commits are granular and messages explain the why.
  • Tool schemas stay backwards-compatible (or the break is called out).
  • Safety-policy changes include tests for both the gated and the confirmed/recovery path. (N/A — no safety-policy change; Linux stubs fail closed.)
  • No default safety gate, app lease, or daemon isolation was disabled to make a test pass.
  • No live GUI/TCC/input checks added to the default suite or hosted CI.
  • Relevant docs updated (README / CHANGELOG / contracts under docs/).

Link to Devin session: https://app.devin.ai/sessions/5f22c5a8af704f368b963a71f94eb46f
Requested by: @minghinmatthewlam


Open in Devin Review

devin-ai-integration Bot and others added 4 commits July 22, 2026 18:22
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
@minghinmatthewlam minghinmatthewlam self-assigned this Jul 22, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 3 commits July 22, 2026 18:35
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
Co-Authored-By: Matthew Lam <minghinmatthew.lam@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

Ran the full Linux self-test battery on Ubuntu x86_64 (Swift 6.0.3), headless shell verification per AGENTS.md non-mutating path.

Results (latest, after daemon-auth fix)

  • swift build and swift test398/398 tests pass
  • scripts/preflight.py --bin .build/debug/computer-use-mcp — all 8 steps pass ("passed": true)
  • CLI version / help / health_report --json — health report correctly shows Accessibility/Screen Recording unsupported, capture skipped, "Linux does not use TCC"
  • MCP serve over stdio — initialize, tools/list (full 30-tool catalog with schemas), and tools/call all respond; tools requiring AX/input/capture (type_text, open_app, page, read_clipboard, …) return structured isError:true "unsupported on Linux" errors — no crashes, no fake success
  • Daemon unix-socket path — initially rejected all peers (stubbed getpeereid); fixed with SO_PEERCRED peer-credential checking and re-verified: call health_report '{}' round-trips through the daemon with no untrusted-peer rejections
  • Also fixed during testing: garbled stub error rendering and placeholder rows in list_apps output
health_report --json (Linux posture)
"permissions": {
  "accessibility":   {"granted": false, "status": "unsupported"},
  "screenRecording": {"granted": false, "status": "unsupported"}
},
"captureService": {"status": "skipped", "detail": "Screen capture is unsupported on Linux."},
"tccAttribution": "Linux does not use TCC."

(Headless CLI/server project — all evidence is terminal output.)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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