Repository navigation
feat(macos): fulfill computer.act v2 natively via Peekaboo - #123801
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 3:46 PM ET / 19:46 UTC. ClawSweeper reviewWhat this changesAdds a native macOS Peekaboo adapter for the computer.act v2 capability contract, including window observations and background window or element actions. Merge readinessThe 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 Review scores
Verification
How this fits togetherThe 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]
Before merge
Findings
Agent review detailsSecurityNeeds attention: Privileged background automation depends directly on a pinned native library whose source-level target-binding contract was not available for this review. PR surfaceOther +1585. Total +1585 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
7616031 to
1fec3ea
Compare
1fec3ea to
08cf239
Compare
|
Merged via squash.
|
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
effectplus escalation guidance.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_menuscreen,window,elementbackground,foregroundimage,accessibilityrecording: false,agentCursor: false,multiDisplay: truezoom,escalate_scopePeekabooAutomationKit 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_valueandinvoke_menureject 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:
set_valueandinvoke_menunow returnCOMPUTER_UNSUPPORTED_ACTION; the adapter no longer focuses an app and misreports an accessibility action as foreground delivery.Evidence
08cf23995fa923201d1a072e3f1f3051910021f2: run 31834196097, including macOS Swift, iOS/shared-kit consumers, Android consumers, native i18n, security, and macOS Node checks.COMPUTER_USE_V2_ACTION_NAMES; the Swift test keeps the frozen 40-name list local and checks exact ordered equality without importing TypeScript..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):
+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.+309/-1.