Skip to content

fix(macos): computer input no longer fails after execution - #134689

Merged
steipete merged 3 commits into
openclaw:mainfrom
gaoanze888:fix/macos-computer-act-result
Sep 2, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
gaoanze888:fix/macos-computer-act-result

Conversation

@gaoanze888

@gaoanze888 gaoanze888 commented Sep 1, 2026 •

Copy link
Copy Markdown

What Problem This Solves

A macOS screen input action could succeed on the desktop and then report COMPUTER_CONTRACT_MISMATCH. The native result included obsolete cursor fields that the strict computer.act consumer rejects, so retrying the apparent failure could repeat the input.

Why This Change Was Made

Return the existing canonical success envelope and remove the obsolete cursor fields/initializer from the native result owner. Native bridge and serialization assertions use that same contract. The shared validator stays strict, and window-action effect, observation, escalation and details fields retain their existing behavior. Production code shrinks by 16 lines.

The first stable release containing this computer-action surface, v2026.8.1 (ea806575e6450e4d1efdfc72c19f04be982a1b9b), already made the Swift cursor fields optional while its TypeScript result schema rejected additional keys. Compiling the unchanged stable Swift decoder against the candidate {"ok":true} result succeeds with both optional cursor values absent. The earlier v1 byte-stability comment concerns the pre-stable shape; this repair retains the working stable wire contract. This evidence does not claim source compatibility for unknown third-party Swift initializer callers.

User Impact

Successful screen input returns {"ok":true} to the existing consumer. Input permissions, lifecycle revalidation, provider selection and failure handling retain their existing behavior.

Evidence

A signed isolated macOS fixture ran the actual screen executor, pinned Peekaboo dependency and shared Swift serializer against a synthetic AppKit window. Its produced JSON was then passed through the actual TypeScript strict decoder:

  • Before: typing delivered the text exactly once, and a key press appended one space; both returned results were rejected for their cursor fields.
  • After: identical desktop effects, both exact {"ok":true} results accepted.
  • Empty text, invalid screen index and unsupported action retained their errors and produced no additional input.
  • All before/after captures were inspected and contain only the synthetic test window.

This proves the changed screen-executor and result boundary. It does not claim a full paired Gateway or packaged-app run. The existing background-window live rig exercises another executor, so it would not demonstrate this reported screen-input failure. This limitation explicitly addresses the broader paired-flow request in the previous ClawSweeper review.

All 11 TypeScript contract tests and 18 shared Swift geometry/serialization tests passed. Pinned SwiftFormat checked all six touched Swift files, and independent P0 review found no actionable issues. Exact final-head hosted CI remains pending the maintainer publication cycle. Thanks @gaoanze888 for the producer-contract repair.

Fixes #134621

Before: input reached the synthetic window once, but the returned cursor fields made the strict consumer reject success.

Before: synthetic screen input completed

After: the same desktop effect occurs once and the canonical {"ok":true} result is accepted. The matching screenshots are expected; the decoder verdicts above establish the repaired result behavior.

After: synthetic screen input completed

The same PR also corrects a stale CLI startup-respawn test: gateway status intentionally skips warning-only respawn, so the fixture now invokes gateway call without its required method and expects argument-validation exit 1. This exercises normal startup respawn without a Gateway RPC and retains the existing trace assertion and deadlines. It changes tests only (+4/-1). The changed case passed on macOS and Linux, the complete changed-file gate passed, and the combined eight-file P0 review found no actionable issue.

This fixture change does not claim to fix the separate 100-second CI help-trace timeout. The macOS candidate whole-file run had 24 passing tests and two unrelated model-list child timeouts. Fixture execution proof used a newer trusted-main CLI cleanup implementation than this branch; final exact-head hosted CI remains required.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@gaoanze888

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 10:41 PM ET / September 2, 2026, 02:41 UTC.

ClawSweeper review

What this changes

The PR removes obsolete cursor coordinates from successful macOS computer-input results, adds canonical wire-envelope assertions, and corrects a CLI startup-respawn test fixture.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for normal completion: current main and stable v2026.8.2 retain the producer/consumer mismatch, while the introduced producer-side repair is the correct boundary and has no actionable review finding.

Priority: P1
Reviewed head: b7d539560eed8b154e7cbd98df0a0f511b1dcddd

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, net-negative owner-boundary repair with direct serialization and strict-consumer coverage plus reported real native after-fix evidence.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body reports an after-fix signed isolated macOS fixture using the real screen executor and shared Swift serializer, with its result accepted by the actual strict TypeScript decoder after the same desktop input effect; the linked screenshots were not retrievable in this review environment.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body reports an after-fix signed isolated macOS fixture using the real screen executor and shared Swift serializer, with its result accepted by the actual strict TypeScript decoder after the same desktop input effect; the linked screenshots were not retrievable in this review environment.
Evidence reviewed 7 items Released affected behavior: Stable v2026.8.2 contains the input-result cursor fields, while its strict result schema permits only the canonical fields and rejects additional properties.
Current-main execution path: Current main routes normal desktop requests to the screen executor, serializes its returned result, and replies through the node bridge; the screen executor still returns cursor fields after dispatch.
Strict consumer contract: The shared schema closes the action-result object and the parser converts a failed validation into COMPUTER_CONTRACT_MISMATCH.
Findings None None.
Security None None.

How this fits together

The macOS app executes computer-control actions and serializes their results through the node bridge to the built-in computer tool. The Gateway validates that result against a strict shared schema before presenting success or failure to the agent.

flowchart LR
  A[Agent computer request] --> B[Gateway computer tool]
  B --> C[macOS node bridge]
  C --> D[Screen action executor]
  D --> E[Shared action result]
  E --> F[Strict result validator]
  F --> G[Agent-visible outcome]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head hosted checks remain incomplete, so merge must wait for the normal required CI gate.
  • Resolve merge risk (P1) - The two linked screenshots could not be retrieved because GitHub DNS failed in this reviewer environment; this is a reviewer limitation, not missing contributor evidence.
  • Complete next step (P2) - No repair lane is needed: the reviewed patch has no actionable defect; complete the ordinary exact-head CI and maintainer review gates.
Agent review details

Security

None.

PR surface

Tests +10, Other -20. Total -10 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 11 1 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 6 11 31 -20
Total 8 22 32 -10

Review metrics

Metric Value Why it matters
Production versus test delta production -16; tests and test support +6 The bug fix removes the incompatible production envelope while adding focused serialization, bridge, and strict-consumer coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #134621
Summary: This PR directly addresses the linked issue's released producer/consumer result-envelope mismatch; the issue remains open until the PR is merged.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the producer-side canonical result after exact-head CI is green; keep the strict TypeScript validator rather than weakening or filtering the wire contract downstream.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the producer-side canonical result after exact-head CI is green; keep the strict TypeScript validator rather than weakening or filtering the wire contract downstream.

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

Yes, source-reproducible: the released and current-main screen executor emits cursor fields after input, and the strict shared validator rejects those additional fields. This read-only review did not execute contributor-controlled source.

Is this the best way to solve the issue?

Yes: removing the obsolete producer fields restores the established canonical envelope at its owner while preserving strict validation and keeping legitimate cursor reporting in the existing details-based window action.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The defect can report a contract failure after computer input has already changed the desktop, inviting an agent retry.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body reports an after-fix signed isolated macOS fixture using the real screen executor and shared Swift serializer, with its result accepted by the actual strict TypeScript decoder after the same desktop input effect; the linked screenshots were not retrievable in this review environment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports an after-fix signed isolated macOS fixture using the real screen executor and shared Swift serializer, with its result accepted by the actual strict TypeScript decoder after the same desktop input effect; the linked screenshots were not retrievable in this review environment.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (4 earlier review cycles)
  • reviewed 2026-09-01T02:59:06.369Z sha 54bb6d9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-01T03:05:19.261Z sha 54bb6d9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-01T03:29:55.138Z sha 54bb6d9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-02T01:22:05.060Z sha c6518ae :: needs maintainer review before merge. :: none

Keep the native bridge assertion focused and exercise both canonical success and obsolete cursor-field rejection at the real TypeScript contract boundary. Preserve the contributor producer repair and the strict consumer.

Signed native screen input and actual decoder before/after proof, shared Swift coverage, pinned formatting, and an independent full seven-file review cover the exact final candidate. The full paired Gateway and packaged native suite were not run.

Co-authored-by: gaoanze <[email protected]>
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The current head removes the obsolete native cursor fields and returns the existing strict success envelope. The PR body includes signed native screen-input proof, matching synthetic before/after captures, unchanged stable decoder compatibility, and the explicit paired-Gateway limitation. Production delta: -16 lines.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 Sep 2, 2026
Gateway status intentionally skips warning-only respawn. Invoke gateway call without its required method so the fixture follows normal startup respawn and exits before any Gateway RPC. Preserve the startup trace assertion, case count and time limits.

The changed case passes on macOS and Linux and the full changed-file gate passes. The original CI help-trace timeout remains unresolved. Preserve the macOS producer repair and its contributor credit.

Co-authored-by: gaoanze <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S and removed size: XS labels Sep 2, 2026
@steipete
steipete merged commit 8c50cf6 into openclaw:main Sep 2, 2026
232 checks passed
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

steipete added a commit that referenced this pull request Sep 2, 2026
Bind native Peekaboo input and references to the exact execution and live
Gateway route. Fence admission, drain operations, release owned input, and
invalidate references before completing managed cleanup.

Carry tool lifetime ownership through Copilot, HTTP/RPC requests, and
CLI/MCP captures. Preserve state across metadata expiry and node inventory
changes; await cleanup before settlement and warm-process handoff.

Retain nested and acknowledged cleanup failures without losing original
errors, cancellation, delivery facts, or prior output. Record terminal
replay denial for failed owned cleanup, including frozen thrown errors.
Keep the narrow numeric cursor receipt contract for older paired nodes.

Use the canonical host constructor and public test loader, preserve Code
Mode control identity, remove obsolete test scaffolding and duplicate
metadata copies, and shrink the assertion baseline. Keep supervisor v6,
worker-result JSON, configuration, dependencies, and storage unchanged.

Fixes #135944. Ref #136049.
Complements #134689 by @gaoanze888; its native producer repair is retained.
steipete added a commit that referenced this pull request Sep 2, 2026
Bind native Peekaboo input and references to the exact execution and live
Gateway route. Fence admission, drain operations, release owned input, and
invalidate references before completing managed cleanup.

Carry tool lifetime ownership through Copilot, HTTP/RPC requests, and
CLI/MCP captures. Preserve state across metadata expiry and node inventory
changes; await cleanup before settlement and warm-process handoff.

Retain nested and acknowledged cleanup failures without losing original
errors, cancellation, delivery facts, or prior output. Record terminal
replay denial for failed owned cleanup, including frozen thrown errors.
Keep the narrow numeric cursor receipt contract for older paired nodes.

Use the canonical host constructor and public test loader, preserve Code
Mode control identity, remove obsolete test scaffolding and duplicate
metadata copies, and shrink the assertion baseline. Keep supervisor v6,
worker-result JSON, configuration, dependencies, and storage unchanged.

Fixes #135944. Ref #136049.
Complements #134689 by @gaoanze888; its native producer repair is retained.
steipete added a commit that referenced this pull request Sep 2, 2026
Bind native Peekaboo input and references to the exact execution and live
Gateway route. Fence admission, drain operations, release owned input, and
invalidate references before completing managed cleanup.

Carry tool lifetime ownership through Copilot, HTTP/RPC requests, and
CLI/MCP captures. Preserve state across metadata expiry and node inventory
changes; await cleanup before settlement and warm-process handoff.

Retain nested and acknowledged cleanup failures without losing original
errors, cancellation, delivery facts, or prior output. Record terminal
replay denial for failed owned cleanup, including frozen thrown errors.
Keep the narrow numeric cursor receipt contract for older paired nodes.

Use the canonical host constructor and public test loader, preserve Code
Mode control identity, remove obsolete test scaffolding and duplicate
metadata copies, and shrink the assertion baseline. Keep supervisor v6,
worker-result JSON, configuration, dependencies, and storage unchanged.

Fixes #135944. Ref #136049.
Complements #134689 by @gaoanze888; its native producer repair is retained.
steipete added a commit that referenced this pull request Sep 2, 2026
Bind native Peekaboo input and references to the exact execution and live
Gateway route. Fence admission, drain operations, release owned input, and
invalidate references before completing managed cleanup.

Carry tool lifetime ownership through Copilot, HTTP/RPC requests, and
CLI/MCP captures. Preserve state across metadata expiry and node inventory
changes; await cleanup before settlement and warm-process handoff.

Retain nested and acknowledged cleanup failures without losing original
errors, cancellation, delivery facts, or prior output. Record terminal
replay denial for failed owned cleanup, including frozen thrown errors.
Keep the narrow numeric cursor receipt contract for older paired nodes.

Use the canonical host constructor and public test loader, preserve Code
Mode control identity, remove obsolete test scaffolding and duplicate
metadata copies, and shrink the assertion baseline. Keep supervisor v6,
worker-result JSON, configuration, dependencies, and storage unchanged.

Fixes #135944. Ref #136049.
Complements #134689 by @gaoanze888; its native producer repair is retained.
steipete added a commit that referenced this pull request Sep 2, 2026
Bind native Peekaboo input and references to the exact execution and live
Gateway route. Fence admission, drain operations, release owned input, and
invalidate references before completing managed cleanup.

Carry tool lifetime ownership through Copilot, HTTP/RPC requests, and
CLI/MCP captures. Preserve state across metadata expiry and node inventory
changes; await cleanup before settlement and warm-process handoff.

Retain nested and acknowledged cleanup failures without losing original
errors, cancellation, delivery facts, or prior output. Record terminal
replay denial for failed owned cleanup, including frozen thrown errors.
Keep the narrow numeric cursor receipt contract for older paired nodes.

Use the canonical host constructor and public test loader, preserve Code
Mode control identity, remove obsolete test scaffolding and duplicate
metadata copies, and shrink the assertion baseline. Keep supervisor v6,
worker-result JSON, configuration, dependencies, and storage unchanged.

Fixes #135944. Ref #136049.
Complements #134689 by @gaoanze888; its native producer repair is retained.
steipete added a commit that referenced this pull request Sep 2, 2026
Bind native Peekaboo input and references to the exact execution and live
Gateway route. Fence admission, drain operations, release owned input, and
invalidate references before completing managed cleanup.

Carry tool lifetime ownership through Copilot, HTTP/RPC requests, and
CLI/MCP captures. Preserve state across metadata expiry and node inventory
changes; await cleanup before settlement and warm-process handoff.

Retain nested and acknowledged cleanup failures without losing original
errors, cancellation, delivery facts, or prior output. Record terminal
replay denial for failed owned cleanup, including frozen thrown errors.
Keep the narrow numeric cursor receipt contract for older paired nodes.

Use the canonical host constructor and public test loader, preserve Code
Mode control identity, remove obsolete test scaffolding and duplicate
metadata copies, and shrink the assertion baseline. Keep supervisor v6,
worker-result JSON, configuration, dependencies, and storage unchanged.

Fixes #135944. Ref #136049.
Complements #134689 by @gaoanze888; its native producer repair is retained.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…134689)

* fix(macos): emit canonical computer action results

* test(macos): verify canonical computer action replies

Keep the native bridge assertion focused and exercise both canonical success and obsolete cursor-field rejection at the real TypeScript contract boundary. Preserve the contributor producer repair and the strict consumer.

Signed native screen input and actual decoder before/after proof, shared Swift coverage, pinned formatting, and an independent full seven-file review cover the exact final candidate. The full paired Gateway and packaged native suite were not run.

Co-authored-by: gaoanze <[email protected]>

* test(cli): exercise startup respawn before argument validation

Gateway status intentionally skips warning-only respawn. Invoke gateway call without its required method so the fixture follows normal startup respawn and exits before any Gateway RPC. Preserve the startup trace assertion, case count and time limits.

The changed case passes on macOS and Linux and the full changed-file gate passes. The original CI help-trace timeout remains unresolved. Preserve the macOS producer repair and its contributor credit.

Co-authored-by: gaoanze <[email protected]>

---------

Co-authored-by: gaoanze <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos cli CLI command changes P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS computer input executes, then result validation rejects it

2 participants