Skip to content

feat(macos): fulfill computer.act v2 natively via Peekaboo - #123801

Merged
steipete merged 1 commit into
mainfrom
steipete/cu-peekaboo-v2
Aug 14, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/cu-peekaboo-v2

Conversation

@steipete

@steipete steipete commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Campaign tracker: docs/plan/computer-use.md

Landed foundations: #123544, #123604, #123635.

What Problem This Solves

The native macOS Peekaboo fulfiller advertised only the original screen-coordinate action family, so selecting Peekaboo could not use the landed computer.act v2 discovery, exact-window observation, background window/element input, lifecycle, or structured effect/escalation contract.

Why This Change Was Made

This keeps the existing v1 path intact and adds a focused native v2 companion around PeekabooAutomationKit's public owner APIs: DesktopObservationService for exact-window screenshots and AX snapshots, UIAutomationService's generation-pinned background routes and action outcomes, plus ApplicationService, WindowManagementService, and MenuService for discovery and lifecycle operations. Opaque app/window/observation/element refs are process-local, execution-local, and invalidated on lifecycle-generation changes; only the newest observation authorizes element or pixel actions.

The shared Swift wire mirrors the landed TypeScript action and result field names without changing gateway protocol or protocol versions. Its decoder accepts only actions advertised by the native path while retaining the complete 40-name v2 enum for cross-language contract alignment. CUA provider behavior and picker semantics are unchanged. Browser, recording, zoom, and escalate_scope remain rejected and unadvertised. No CHANGELOG entry is included per the W2-PKB work order.

User Impact

When Peekaboo is selected on macOS, the node now publishes a real v2 descriptor and can discover apps/windows, observe an exact window with a PNG plus bounded AX elements, act against fresh opaque refs in the background by default, explicitly promote supported pointer/keyboard actions to foreground delivery, manage app lifecycle, and return effect plus escalation guidance.

Surface Peekaboo v2 capability
Actions screenshot, existing v1 input family, list_apps, list_windows, get_accessibility_tree, get_cursor_position, get_window_state, launch_app, kill_app, bring_to_front, set_value, invoke_menu
Background exact-window left/right/double click, element click/focus, type, key, element scroll, set value, menu invocation
Foreground explicit targeted left/right/middle/double/triple click, type, key, scroll, bring-to-front
Targets screen, window, element
Delivery modes background, foreground
Observations image, accessibility
Features recording: false, agentCursor: false, multiDisplay: true
Not advertised browser family, recording/replay family, zoom, escalate_scope

PeekabooAutomationKit does not publicly provide background middle/triple click or held/split-pointer variants. Background requests for unavailable variants return a structured foreground recommendation; the existing screen/foreground v1 behavior remains available. set_value and invoke_menu reject foreground delivery because both Peekaboo and the sibling CUA provider implement them as background accessibility actions.

Review Follow-up

The latest ClawSweeper rank-up moves are addressed on this head:

  • Every awaited Peekaboo discovery, observation, lifecycle, and input operation is fenced by the queue-owned lifecycle authority before and after the await. A lifecycle change cancels the task and prevents later effects or result commitment.
  • Foreground set_value and invoke_menu now return COMPUTER_UNSUPPORTED_ACTION; the adapter no longer focuses an app and misreports an accessibility action as foreground delivery.
  • Focused regressions cover post-await authority revalidation, result-commit rejection after revocation, and both accessibility-only foreground rejections.

Evidence

  • Exact-head CI is green for 08cf23995fa923201d1a072e3f1f3051910021f2: run 31834196097, including macOS Swift, iOS/shared-kit consumers, Android consumers, native i18n, security, and macOS Node checks.
  • Unit/contract proof is complete: macOS Swift suite, 3 wire-decode tests, 25 focused ComputerActionService tests, 18 ComputerInputGeometry tests, 2,024 Vitest assertions across the CUA/contract/tool shards, typechecks, Swift/TypeScript lint, deadcode, formatting, and final branch autoreview are clean.
  • The coordinator verified all Swift action raw values against COMPUTER_USE_V2_ACTION_NAMES; the Swift test keeps the frozen 40-name list local and checks exact ordered equality without importing TypeScript.
  • Pinned Peekaboo source was inspected directly for action routing, accessibility delivery, mutation-lane cancellation, and lifecycle behavior.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean; TruffleHog clean, no accepted/actionable findings.

Live end-to-end proof through a paired node is DEFERRED to the W3-GATE integration row, which owns the authenticated dev-gateway rig. An isolated gateway starts and the app connects, but node pairing needs the rig W3-GATE builds. This PR does not claim live paired-node proof.

Production/test numstat (moves/generated files excluded):

  • Production: +1289/-12 (net +1277). The positive delta is the concrete native v2 capability, cross-language wire envelope, lifecycle-scoped reference owner, queue-authority fencing, and connect descriptor; the prior v1 fulfiller remains unchanged by contract.
  • Tests: +309/-1.

@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.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 3:46 PM ET / 19:46 UTC.

ClawSweeper review

What this changes

Adds a native macOS Peekaboo adapter for the computer.act v2 capability contract, including window observations and background window or element actions.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

The prior lifecycle-authority and foreground-accessibility blockers are addressed on this head. Keep this maintainer PR open until the signed-app Peekaboo proof and pinned automation-library contract are reviewed; no additional source-proven patch defect was found.

Priority: P1
Reviewed head: 08cf23995fa923201d1a072e3f1f3051910021f2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch addresses the previously reported blockers, but merge confidence still needs signed-app and upstream-contract evidence.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer PR is exempt from contributor-proof gating, though signed-app hardware evidence remains merge-relevant and is described as pending in the PR body.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer PR is exempt from contributor-proof gating, though signed-app hardware evidence remains merge-relevant and is described as pending in the PR body.
Evidence reviewed 6 items V2 dispatch and authority owner: The native service sends v2 requests through the existing execution queue and passes a lifecycle-authority callback into the adapter.
Prior lifecycle blocker addressed: The adapter checks authority both before and after awaited work, and focused tests revoke lifecycle authority during an await.
Prior foreground-action blocker addressed: Accessibility-only set_value and invoke_menu requests explicitly reject foreground delivery, with focused regression coverage.
Findings None None.
Security Needs attention Confirm native target binding: The adapter delegates background click, keyboard, value, and menu operations to Peekaboo APIs; review the pinned source or types and signed-app trace to confirm those calls remain bound to the resolved window, element, and lifecycle state.

How this fits together

The macOS node publishes a provider capability descriptor to the agent and routes armed computer actions to the selected native provider. This extends Peekaboo from coordinate-only input to window- and accessibility-targeted operations.

flowchart LR
A[Agent computer action] --> B[Mac node capability descriptor]
B --> C[Selected Peekaboo provider]
C --> D[Lifecycle authority check]
D --> E[Native automation services]
E --> F[Action result and observation]
Loading

Before merge

  • Resolve security concern: Confirm native target binding - The adapter delegates background click, keyboard, value, and menu operations to Peekaboo APIs; review the pinned source or types and signed-app trace to confirm those calls remain bound to the resolved window, element, and lifecycle state.
  • Resolve merge risk (P1) - The privileged background-action boundary relies on Peekaboo APIs whose target-binding contract was not independently inspected, and the PR body still identifies signed-app hardware proof as pending.
  • Complete next step (P2) - A protected maintainer PR that expands a privileged native action boundary needs human review of signed-app evidence and the dependency contract before merge.

Findings

  • [medium] Confirm native target binding — apps/macos/Sources/OpenClaw/ComputerActionServiceV2.swift:400
Agent review details

Security

Needs attention: Privileged background automation depends directly on a pinned native library whose source-level target-binding contract was not available for this review.

PR surface

Other +1585. Total +1585 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 10 1598 13 +1585
Total 10 1598 13 +1585

Review metrics

Metric Value Why it matters
Production versus test LOC production +1,182/-18 (net +1,164); tests +88/-1 (net +87) This substantial privileged capability addition needs native runtime validation beyond its focused unit and wire-contract tests.

Merge-risk options

Maintainer options:

  1. Verify the signed native path (recommended)
    Attach redacted signed-app evidence showing a window observation, a background target action, and lifecycle revocation handling against the selected Peekaboo provider.

Technical review

Best possible solution:

Keep the adapter at the macOS provider boundary, preserve its per-await authority checks, and land only after redacted signed-app proof confirms exact-window observation, background delivery, and lifecycle revocation.

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

Not applicable as a feature PR; the merge-relevant evidence path is a signed macOS run that observes a window and performs a background action, which could not run in this read-only Linux review environment.

Is this the best way to solve the issue?

Yes for owner placement: the macOS provider owns its native Peekaboo behavior while shared TypeScript remains capability-driven. Merge readiness remains unclear until the pinned dependency target-binding contract and signed-app behavior are shown.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 986be4558f11.

Labels

Label justifications:

  • P1: This expands a central agent computer-control workflow across macOS nodes and warrants prompt maintainer attention.
  • merge-risk: 🚨 security-boundary: Background automation relies on native dependency APIs to preserve target and lifecycle boundaries, which still need direct contract and signed-app validation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer PR is exempt from contributor-proof gating, though signed-app hardware evidence remains merge-relevant and is described as pending in the PR body.

Evidence

Security concerns:

  • [medium] Confirm native target binding — apps/macos/Sources/OpenClaw/ComputerActionServiceV2.swift:400
    The adapter delegates background click, keyboard, value, and menu operations to Peekaboo APIs; review the pinned source or types and signed-app trace to confirm those calls remain bound to the resolved window, element, and lifecycle state.
    Confidence: 0.84

What I checked:

Likely related people:

  • steipete: The current computer-control implementation and this PR head trace to commits by Peter Steinberger. (role: feature owner and recent area contributor; confidence: high; commits: f8dbd34ab8e8, 461772868da3, 08cf23995fa9; files: apps/macos/Sources/OpenClaw/ComputerActionService.swift, apps/macos/Sources/OpenClaw/ComputerControlProvider.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted signed-app proof for an exact-window observation, background action, and lifecycle revocation.
  • Confirm the pinned Peekaboo target-binding contract against its source or types.

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 (2 earlier review cycles)
  • reviewed 2026-08-14T19:06:38.992Z sha 7616031b2caaead0a832ce43347ea5de154cde87 :: needs real behavior proof before merge. :: [P2] Reject foreground set_value until Peekaboo supports it
  • reviewed 2026-08-14T19:31:40.409Z sha 1fec3ea2b28e4ff83b313fb68d30e642b5f26cf1 :: found issues before merge. :: [P1] Revalidate lifecycle authority around v2 native actions | [P2] Reject foreground accessibility-only actions

@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos cli CLI command changes size: XL maintainer Maintainer-authored PR labels Aug 14, 2026
@steipete
steipete force-pushed the steipete/cu-peekaboo-v2 branch from 7616031 to 1fec3ea Compare August 14, 2026 19:25
@steipete steipete self-assigned this Aug 14, 2026
@steipete
steipete marked this pull request as ready for review August 14, 2026 19:25
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 14, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the cli CLI command changes label Aug 14, 2026
@steipete
steipete force-pushed the steipete/cu-peekaboo-v2 branch from 1fec3ea to 08cf239 Compare August 14, 2026 19:38
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 14, 2026
@steipete
steipete merged commit 4a6edc0 into main Aug 14, 2026
68 checks passed
@steipete
steipete deleted the steipete/cu-peekaboo-v2 branch August 14, 2026 21:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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