Skip to content

feat(macos): add embedded CUA computer provider - #123635

Merged
steipete merged 8 commits into
mainfrom
steipete/cu-macos-embedded-host
Aug 14, 2026
Merged

steipete merged 8 commits into
mainfrom
steipete/cu-macos-embedded-host

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Campaign plan: https://github.com/openclaw/openclaw/blob/steipete/computer-use-plan/docs/plan/computer-use.md

Landed chain: #123509 → #123544 → #123604

What Problem This Solves

OpenClaw.app could not use the CUA provider without giving the driver a separate macOS TCC identity: a daemon spawned by the Gateway or TypeScript worker inherits that process's responsibility chain, not the signed app's Accessibility and Screen Recording grants. The Mac node also had no node-local provider choice, and native snapshot/action dispatch always won over the worker.

Why This Change Was Made

The signed app now owns the complete embedded-daemon lifecycle and exposes a generation-scoped private socket to its TypeScript node worker. Settings chooses exactly one provider—Peekaboo by default or CUA—with provider-selected manifest merging and dispatch, no per-call fallback, and worker/proxy teardown before daemon replacement.

The CUA worker uses the pinned 0.19.3 MCP proxy instead of CuaDriver.connect: upstream authenticates trusted SDK sessions to the daemon's exact parent PID, so the sibling worker cannot attach through that API. Packaging downloads the pinned universal binary, verifies SHA-256 733e28a3782ac8d325f8fce8b5d97486c1054af755b40dfd086151b34c79377e, stages it in Resources, and signs the nested executable before the app bundle.

User Impact

Mac users keep today's Peekaboo behavior by default. Packaged builds add a Computer Control provider picker; selecting CUA starts the app-owned embedded host, advertises the v2 CUA capability descriptor only after socket readiness, and makes failures visibly unavailable instead of mixing providers. Development builds without the artifact show CUA (driver not bundled) as unavailable and never search PATH.

Evidence

Before:

Computer Control settings before

After:

Computer Control provider picker

  • swift test --package-path apps/macos --enable-code-coverage --parallel — passed (exact macos-swift CI test invocation)
  • swift build --package-path apps/macos --product OpenClaw --configuration release — passed
  • focused Swift lifecycle/precedence/connect suites — passed (111 tests before final lifecycle tightening; final affected subset 74 tests)
  • node scripts/run-vitest.mjs extensions/cua-computer — passed (68 tests)
  • node scripts/run-vitest.mjs test/scripts/package-mac-app.test.ts — passed (48 tests)
  • pnpm tsgo and pnpm check:test-types — passed
  • pnpm deadcode:full — passed
  • pnpm check:import-cycles — 0 runtime value cycles
  • pnpm check:madge-import-cycles — 0 cycles
  • changed-path Oxlint, SwiftLint, SwiftFormat, pnpm format:check, pnpm check:docs, native state schema guard, shell syntax, and git diff --check — passed
  • real staging probe verified the release archive digest, x86_64 arm64, and installed mode 0755
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, no accepted/actionable findings

Production LOC: +1715/-68 (net +1647) | Tests: +934/-3 (net +931). The production growth is the new TCC/lifecycle ownership boundary plus the bounded MCP client required by the upstream parent-PID contract; no protocol, SQLite, pairing, or arming semantics changed.

Live TCC proof pending coordinator. This PR intentionally stops at deterministic lifecycle, transport, packaging, and dispatch proof; the coordinator will run the signed-app Accessibility/Screen Recording inheritance scenario on real hardware before landing.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos scripts Repository scripts plugin: cua-computer size: XL maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 14, 2026, 11:47 AM ET / 15:47 UTC.

ClawSweeper review

What this changes

This PR adds an embedded CUA driver option to the macOS Computer Control setting, with app-owned daemon lifecycle, MCP worker transport, packaging, and provider-specific command dispatch.

Regression provenance

Possible regression — probable (reviewed change; reproduction). No predecessor PR is attributed.

Merge readiness

⛔ Blocked by patch quality or review findings - 10 items remain

Keep open and do not merge: enabling the CUA plugin by default on Darwin makes its global dangerous-command policy remove the existing Peekaboo computer.act default unless users add a new allowlist entry. The prior embedded-socket authentication blocker also remains unaddressed, and the PR itself says signed-app TCC proof is pending.

Priority: P1
Reviewed head: e12226bc89c8a1813186214b6a7fe21c7d3b87bd

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The feature has substantial test evidence, but two P1 default/security blockers make the patch not quality-ready.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; nevertheless, the PR body explicitly says signed-app TCC inheritance proof remains pending before landing.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; nevertheless, the PR body explicitly says signed-app TCC inheritance proof remains pending before landing.
Evidence reviewed 7 items Default-path regression: The PR adds Darwin default activation for cua-computer. The plugin registers computer.act as dangerous, while Gateway removes every dangerous plugin command from the runtime allowlist before adding explicit operator allows; that applies by command name, not selected provider.
Current policy owner: Current main collects dangerous plugin node commands globally and filters them out of the default command allowlist. The macOS platform otherwise includes computer.act by default.
Plugin policy registration: The current CUA plugin registers computer.act as a dangerous invoke policy without provider or platform scoping.
Findings 2 actionable findings [P1] Preserve Peekaboo’s default computer-control allowlist
[P1] Authenticate the embedded CUA socket client
Security Needs attention Embedded CUA endpoint lacks proven client authentication: The previous review identified a P1 at the app-owned socket boundary; later commits supplied in context do not modify that protocol, so the new desktop-control authority cannot yet be treated as isolated to the intended worker.

How this fits together

The macOS app advertises screen and computer-control commands to Gateway; Gateway then applies command policy before the agent’s computer tool can invoke them. The selected provider supplies snapshots and actions through the existing native path or the new embedded CUA host.

flowchart LR
  Settings[Mac provider setting] --> App[macOS app]
  App --> Host[Embedded CUA host]
  Host --> Worker[Node worker]
  Worker --> Gateway[Gateway command policy]
  Gateway --> Tool[Computer tool]
  Tool --> Desktop[Desktop snapshots and actions]
Loading

Before merge

  • Preserve Peekaboo’s default computer-control allowlist (P1) - Enabling this plugin by default on Darwin loads its dangerous computer.act policy even when the Mac has selected Peekaboo. Gateway filters that command globally, so existing macOS users lose the documented default until they add a new allow entry. Scope the policy to CUA-advertising nodes or keep this plugin opt-in, and add the upgrade regression.
  • Authenticate the embedded CUA socket client (P1) - This re-raises the prior P1: the app-owned driver carries the app’s desktop-control authority, while the worker reaches it through a private socket. The commits after the prior reviewed head do not repair that host protocol, so an unauthorized local client can still reach the daemon unless the endpoint authenticates the current worker.
  • Resolve security concern: Embedded CUA endpoint lacks proven client authentication - The previous review identified a P1 at the app-owned socket boundary; later commits supplied in context do not modify that protocol, so the new desktop-control authority cannot yet be treated as isolated to the intended worker.
  • Resolve merge risk (P1) - Merging the Darwin default activation silently makes existing macOS Peekaboo computer control require gateway.nodes.commands.allow: ["computer.act"].
  • Resolve merge risk (P1) - The embedded host exposes unrestricted desktop authority through a private socket; the prior P1 requiring client authentication has not been superseded by a host-protocol change.
  • Resolve merge risk (P1) - The PR body explicitly leaves signed-app Accessibility and Screen Recording inheritance proof pending; unit, packaging, and UI-picker evidence do not establish that TCC behavior.
  • Complete next step (P2) - A maintainer-owned, security-sensitive provider boundary needs the two P1 repairs and signed-app proof rather than automated triage closure.
  • Improve patch quality - Scope CUA policy to CUA-advertising nodes and prove existing Peekaboo upgrades retain computer.act.
  • Improve patch quality - Authenticate the embedded socket client and add a focused negative-client regression.
  • Improve patch quality - Attach redacted signed-app Accessibility and Screen Recording inheritance evidence.

Findings

  • [P1] Preserve Peekaboo’s default computer-control allowlist — extensions/cua-computer/openclaw.plugin.json:7
  • [P1] Authenticate the embedded CUA socket client — apps/macos/Sources/OpenClaw/CuaDriverHostCoordinator.swift:1
  • [high] Embedded CUA endpoint lacks proven client authentication
Agent review details

Security

Needs attention: The PR adds an unrestricted TCC-bearing driver boundary, and its previously reported worker-socket authentication defect remains unresolved.

PR surface

Source +727, Tests +423, Docs +19, Config 0, Other +2248. Total +3417 across 35 files.

View PR surface stats
Area Files Added Removed Net
Source 4 742 15 +727
Tests 4 426 3 +423
Docs 1 36 17 +19
Config 1 1 1 0
Generated 0 0 0 0
Other 25 2292 44 +2248
Total 35 3497 80 +3417

Review metrics

Metric Value Why it matters
Production versus test delta production +1,715/-68; tests +934/-3 The PR body reports substantial new lifecycle and transport code, so the default-path and security boundaries need direct proof.
Default and settings surfaces 1 persisted provider setting added; 1 platform default activation added The new provider picker and Darwin plugin default can affect upgraded macOS installations before an operator changes configuration.

Stored data model

Persistent data-model change detected: serialized state: apps/macos/Tests/OpenClawIPCTests/CuaDriverHostCoordinatorTests.swift, serialized state: extensions/cua-computer/index.test.ts, serialized state: extensions/cua-computer/src/mcp-driver-client.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Repair provider-scoped policy and socket trust (recommended)
    Keep the CUA picker, but prevent its policy from downgrading Peekaboo and prove only the intended worker can use the embedded endpoint before merge.
  2. Pause the embedded provider
    Defer the macOS CUA path if provider-scoped authorization and signed-app TCC proof cannot be established in this PR.

Technical review

Best possible solution:

Scope CUA’s dangerous policy to nodes that advertise the CUA provider so it cannot change Peekaboo’s existing default, authenticate the embedded-worker endpoint, add an upgrade regression, then record a redacted signed-app TCC run.

Do we have a high-confidence way to reproduce the issue?

Yes—source-reproducible: activate the Darwin CUA plugin without an explicit gateway allow entry; its dangerous policy removes computer.act despite the normal macOS default. Current policy coverage demonstrates that exact allowlist behavior.

Is this the best way to solve the issue?

No. App-owned CUA lifecycle is a plausible TCC boundary, but global CUA policy must not govern the unrelated Peekaboo provider, and the worker endpoint needs authentication plus real signed-app proof.

Full review comments:

  • [P1] Preserve Peekaboo’s default computer-control allowlist — extensions/cua-computer/openclaw.plugin.json:7
    Enabling this plugin by default on Darwin loads its dangerous computer.act policy even when the Mac has selected Peekaboo. Gateway filters that command globally, so existing macOS users lose the documented default until they add a new allow entry. Scope the policy to CUA-advertising nodes or keep this plugin opt-in, and add the upgrade regression.
    Confidence: 0.98
  • [P1] Authenticate the embedded CUA socket client — apps/macos/Sources/OpenClaw/CuaDriverHostCoordinator.swift:1
    This re-raises the prior P1: the app-owned driver carries the app’s desktop-control authority, while the worker reaches it through a private socket. The commits after the prior reviewed head do not repair that host protocol, so an unauthorized local client can still reach the daemon unless the endpoint authenticates the current worker.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 59533cb0fb4a.

Labels

Label changes:

  • remove merge-risk: 🚨 availability: Current PR review merge-risk labels are merge-risk: 🚨 compatibility, merge-risk: 🚨 security-boundary.

Label justifications:

  • P1: The branch can break the existing default macOS computer-control workflow for users who have not changed gateway command settings.
  • merge-risk: 🚨 compatibility: Default activation changes whether an existing computer.act capability stays in Gateway’s default allowlist.
  • merge-risk: 🚨 security-boundary: The embedded daemon receives desktop-control authority through a local worker endpoint whose client-authentication blocker remains open.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; nevertheless, the PR body explicitly says signed-app TCC inheritance proof remains pending before landing.

Evidence

Security concerns:

  • [high] Embedded CUA endpoint lacks proven client authentication
    The previous review identified a P1 at the app-owned socket boundary; later commits supplied in context do not modify that protocol, so the new desktop-control authority cannot yet be treated as isolated to the intended worker.
    Confidence: 0.82

What I checked:

  • Default-path regression: The PR adds Darwin default activation for cua-computer. The plugin registers computer.act as dangerous, while Gateway removes every dangerous plugin command from the runtime allowlist before adding explicit operator allows; that applies by command name, not selected provider. (extensions/cua-computer/openclaw.plugin.json:7, e12226bc89c8)
  • Current policy owner: Current main collects dangerous plugin node commands globally and filters them out of the default command allowlist. The macOS platform otherwise includes computer.act by default. (src/gateway/node-command-policy.ts:411, 59533cb0fb4a)
  • Plugin policy registration: The current CUA plugin registers computer.act as a dangerous invoke policy without provider or platform scoping. (extensions/cua-computer/index.ts:29, 59533cb0fb4a)
  • Existing regression proof: Current main’s policy test explicitly proves that registering CUA’s dangerous policy makes computer.act unavailable until gateway.nodes.commands.allow contains it. (src/gateway/node-command-policy.test.ts:785, 59533cb0fb4a)
  • History and ownership: Blame attributes the current CUA dangerous-policy registration and macOS computer-command default to Peter Steinberger’s current-main commit ee6c2cb; feature history includes the original macOS computer-use commit f8dbd34. (extensions/cua-computer/index.ts:29, ee6c2cb50df0)
  • Prior blocker continuity: The prior completed review at a7f5294 listed embedded CUA socket-client authentication as a P1. The supplied later commits are i18n, Swift style, and Gateway connect-parameter refactoring, not a host-protocol repair. (e12226bc89c8)

Likely related people:

  • steipete: Current-main blame ties the CUA policy and macOS computer command defaults to Peter Steinberger, and the supplied PR history identifies steipete as the current feature author. (role: original macOS computer-use owner and recent area contributor; confidence: high; commits: f8dbd34ab8e8, 5c6bccff4a10, ee6c2cb50df0; files: src/gateway/node-command-policy.ts, extensions/cua-computer/index.ts, extensions/cua-computer/openclaw.plugin.json)
  • Dallin Romney: Recent current-main history owns the CUA Driver 0.19.3 upgrade and retired-driver handling used by this provider. (role: recent CUA dependency contributor; confidence: medium; commits: 1d45930162ca, 484765582656; files: extensions/cua-computer/package.json, extensions/cua-computer/src/driver-client.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-14T12:05:09.617Z sha 0535326 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T13:29:44.862Z sha 36c381d :: found issues before merge. :: [P1] Authenticate the embedded daemon socket client
  • reviewed 2026-08-14T14:24:18.045Z sha 9c5613f :: found issues before merge. :: [P1] Authenticate the embedded CUA socket client
  • reviewed 2026-08-14T14:39:27.442Z sha a7f5294 :: found issues before merge. :: [P1] Authenticate the embedded CUA socket client | [P2] Preserve CUA selection when the driver is unavailable
  • reviewed 2026-08-14T14:56:48.618Z sha a7f5294 :: found issues before merge. :: [P1] Prevent CUA policy from revoking native macOS control | [P1] Authenticate the embedded CUA socket client

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 14, 2026
@steipete steipete self-assigned this Aug 14, 2026
@steipete
steipete force-pushed the steipete/cu-macos-embedded-host branch from 1a85995 to a7f5294 Compare August 14, 2026 14:33
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Aug 14, 2026
@steipete steipete closed this Aug 14, 2026
@steipete steipete reopened this Aug 14, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 14, 2026
@steipete
steipete marked this pull request as ready for review August 14, 2026 15:22
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Aug 14, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Aug 14, 2026
@steipete
steipete merged commit 19ace68 into main Aug 14, 2026
178 checks passed
@steipete
steipete deleted the steipete/cu-macos-embedded-host branch August 14, 2026 17:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 14, 2026
steipete added a commit that referenced this pull request Aug 14, 2026
…r.act v2) (#123464)

* docs(plan): computer-use campaign plan — two-provider background computer use (CUA + Peekaboo) behind computer.act v2

* docs(plan): resolve W0-PIN — pinned 0.19.3 already contains inherited IPC and consent adapter

* docs(plan): W0 complete — parity fixtures landed (#123469)

* docs(plan): W1-SEAM landed (#123509)

* docs(plan): W1 complete — v2 contract landed (#123544)

* docs(plan): W2-CUA landed (#123604)

* docs(plan): W2-MAC landed (#123635)

* docs(plan): note picker screenshot evidence belongs to W2-UX

* docs(plan): avoid inline-html placeholder in tracker note
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
* feat(macos): embed CUA computer provider

* fix(macos): clarify embedded CUA trust posture

* fix(macos): contain embedded CUA daemon lifecycle

* fix(macos): reap orphaned CUA daemons

* fix(macos): record the spawned CUA daemon pid so reaping can terminate orphans

* chore(macos): refresh native i18n baseline for the computer control provider picker

* style(macos): satisfy swiftlint on the embedded CUA host and connect params

* refactor(gateway): move optional connect params to GatewayConnectOptions
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…r.act v2) (openclaw#123464)

* docs(plan): computer-use campaign plan — two-provider background computer use (CUA + Peekaboo) behind computer.act v2

* docs(plan): resolve W0-PIN — pinned 0.19.3 already contains inherited IPC and consent adapter

* docs(plan): W0 complete — parity fixtures landed (openclaw#123469)

* docs(plan): W1-SEAM landed (openclaw#123509)

* docs(plan): W1 complete — v2 contract landed (openclaw#123544)

* docs(plan): W2-CUA landed (openclaw#123604)

* docs(plan): W2-MAC landed (openclaw#123635)

* docs(plan): note picker screenshot evidence belongs to W2-UX

* docs(plan): avoid inline-html placeholder in tracker note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. plugin: cua-computer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant