Repository navigation
feat(nodes): add computer use (computer.act) on macOS nodes via Peekaboo - #102776
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 9:55 AM ET / 13:55 UTC. Summary PR surface: Source +722, Tests +422, Docs +69, Other +1247. Total +2460 across 31 files. Reproducibility: yes. for the current review findings by source inspection: Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Gate desktop control behind explicit Do we have a high-confidence way to reproduce the issue? Yes for the current review findings by source inspection: Is this the best way to solve the issue? No as submitted. The feature direction is plausible, but the arming semantics, malformed input handling, proof gate, and ownership/security decision must be resolved before this is the maintainable merge path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 47cc6c96674d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +722, Tests +422, Docs +69, Other +1247. Total +2460 across 31 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ce2f2916
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (coordinate && coordinate.length === 2) { | ||
| wire.x = coordinate[0]; | ||
| wire.y = coordinate[1]; | ||
| } |
There was a problem hiding this comment.
Reject malformed optional coordinates
When scroll, left_mouse_down, or left_mouse_up receives a malformed coordinate array (for example one value or three values), this branch just omits x/y and the Mac node deliberately acts at the current cursor. Because tool callers are not revalidated against the TypeBox tuple inside execute, bad model/tool input can scroll/press/release at a stale location instead of failing closed; treat any present optional coordinate whose length is not 2 as invalid.
Useful? React with 👍 / 👎.
24ce2f2 to
41b9a74
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41b9a74052
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!Array.isArray(raw)) { | ||
| return undefined; | ||
| } | ||
| const values = raw.map((entry) => Number(entry)); |
There was a problem hiding this comment.
Reject non-number coordinate entries
For malformed tool input where a coordinate array contains non-number values such as null, false, or numeric strings, this coercion turns them into finite numbers (null/false become 0, strings become their numeric value) and the required-coordinate actions will click/drag at those unintended pixels instead of failing. Since execute receives raw tool arguments and this helper is the coordinate guard before forwarding computer.act, validate that each entry is actually a finite number rather than applying Number() coercion.
Useful? React with 👍 / 👎.
…8n, doc-comment constants
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0337a3d1ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let from = try self.point(params.fromX, params.fromY, params: params, display: display) | ||
| ?? to |
There was a problem hiding this comment.
Reject drag actions without an origin
When computer.act is invoked directly with action: "left_click_drag" but no fromX/fromY, this fallback uses the destination as the origin and still dispatches a drag/click at the target. The agent tool requires startCoordinate before forwarding, but computer.act is an armed node command exposed through node.invoke, so malformed direct callers can synthesize unintended input instead of getting the same fail-closed validation; require the drag origin here rather than defaulting to to.
Useful? React with 👍 / 👎.
| /phone disarm | ||
| ``` | ||
|
|
||
| Arming requires `operator.admin` (or the owner) and auto-expires. Arming only toggles what the gateway may invoke; the macOS app still enforces its **Allow Computer Control** setting and Accessibility permission. Operators can equivalently add `computer.act` to `gateway.nodes.allowCommands`. |
There was a problem hiding this comment.
Tell manual arming to clear the denylist
On a fresh gateway setup, src/wizard/setup.gateway-config.ts seeds gateway.nodes.denyCommands from DEFAULT_DANGEROUS_NODE_COMMANDS, and this PR adds computer.act to that list; src/gateway/server-methods/nodes.ts then lets denyCommands override allowCommands. With that default config, following this sentence and only adding computer.act to gateway.nodes.allowCommands leaves computer control blocked, unlike /phone arm computer which removes it from the denylist too. The docs should say to remove it from gateway.nodes.denyCommands as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cce077d096
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| typeof params.screenIndex === "number" && Number.isInteger(params.screenIndex) | ||
| ? Math.max(0, params.screenIndex) |
There was a problem hiding this comment.
Reject invalid screenIndex instead of clamping it
When malformed tool input supplies a negative screenIndex, this turns it into 0 instead of failing the call. Because coordinate actions treat any explicit screen index as enough to bypass the “take a screenshot first” frame guard, screenIndex: -1 can make a click/drag/scroll target display 0 even though the schema requires a non-negative integer; reject invalid values here rather than silently retargeting the desktop.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
…boo (openclaw#102776) * feat(nodes): add computer use (computer.act) on macOS nodes via Peekaboo * fix(nodes): release held computer.act input on node disconnect/stop/disable * fix(nodes): release held computer.act input armed after a lifecycle release * fix(nodes): scope computer.act lifecycle catch-up release to the arming action * chore(nodes): register computer tool display metadata, sync native i18n, doc-comment constants * fix(nodes): preserve caught-error cause in computer tool resolver; regen docs map
Related: #97333
What Problem This Solves
OpenClaw agents could see a desktop node's screen (
screen.snapshot) but could not act on it — there was no way for an agent to click, type, scroll, or drag on a paired macOS machine. This adds agent-driven desktop control, so a Mac node can be driven end-to-end (screenshot → reason → act) instead of being a read-only surface.Why This Change Was Made
The contract is deliberately node-agnostic: the agent emits one dangerous node command,
computer.act, whose action set mirrors Anthropic'scomputer_20251124(click/type/key/scroll/drag/zoom/wait, modifiers on thetextfield). The agent cannot tell how a node fulfills it. macOS nodes fulfill it in-process via the Peekaboo automation engine already embedded in OpenClaw.app, so mouse/keyboard synthesis runs under the signed app's Accessibility + Screen-Recording grants (no ambient-binary TCC widening). Other platforms can later fulfill the identicalcomputer.act— e.g. via an MCP — with zero agent-side change.Safety is built in:
computer.actis on the dangerous-command list and is excluded from the runtime allowlist until explicitly armed; the pairing surface still advertises it so the node can be armed. Arming reuses phone-control'soperator.admin-gated, time-boundedarm/disarm(newcomputergroup).{node, display, delivered-pixel-width}the model observed; input actions fail closed when no matching screenshot frame exists, reject out-of-frame/partial/refWidth<=0coordinates, clamp to the selected display, and serialize per tool instance so parallel tool calls can't reorder real desktop input.User Impact
An operator can enable Computer Control on a Mac node and arm it (
/phone arm computer --for 30m); the agent can then screenshot the desktop and click, type, use key combos, scroll, and drag. It is off by default, requires the OpenClaw.app Accessibility/Screen-Recording grants, and is time-boxed. No behavior changes for anyone who does not enable it.Evidence
Local proof (all green):
computer-tooltool tests (contract, coordinate scaling, frame binding, fail-closed, node-switch, multi-display), plusnode-command-policy(dangerous-by-default, pairing-under-denylist regression),node-connect-reconcile, andphone-controlarming.ComputerInputGeometryunit tests (Retina/portrait/landscape scaling, display clamp, non-positive refWidth);OpenClawapp target compiles against Peekaboo 3.5.2; Mac node runtime tests (computer.actrouting, disabled-gate, cap advertisement).mainand re-verified: TS suites, OpenClawKit tests, full app build, and 56 Mac-node Swift tests pass.Review: Codex autoreview run to convergence over six rounds; 13 findings fixed (coordinate scaling, drag-modifier retention, watchdog refresh, fresh-setup denylist pairing bug, multi-display targeting, delivered-dimension reporting, frame binding, out-of-frame/partial/
refWidthvalidation, and per-instance serialization for parallel tool calls).Outstanding before merge (this is why the PR is a draft):
left_mouse_down, if arm expiry //phone disarm/ disconnect / disabling Computer Control prevents the matchingleft_mouse_up, only a 120s idle watchdog releases the synthetic button. A lifecycle-release hook (release outstanding input on disable/disconnect/disarm) should replace the watchdog as the primary cleanup.