Repository navigation
fix(computer): prevent stale, replayed, and post-cancel desktop actions - #103422
Merged
Merged
Conversation
Contributor
Author
|
Land-ready at exact head Proof:
Known proof gap remains documented in the PR body: the source-blind autonomous GUI loop needs an isolated signed app, isolated Gateway/port, and GUI/VNC session. Production clawmac app and Gateway were intentionally untouched; this is not a code-gate failure. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 10, 2026
…ns (openclaw#103422) * fix(ai): preserve streamed tool-call identity * fix(computer): bind actions to current tool authority * fix(macos): serialize computer control lifecycle * docs(computer): document hardened control contract * chore: follow release-owned changelog policy * test(agents): cover node list cancellation
This was referenced Jul 12, 2026
yetval
added a commit
to yetval/openclaw
that referenced
this pull request
Jul 17, 2026
… rebuilds Gateway tools.invoke (RPC and POST /tools/invoke) resolves a fresh tool set on every call, so the computer tool's held-button cross-node retarget guard from openclaw#103422 lived in closure state that never survived to the next call: a second left_mouse_down aimed at another node was dispatched while the first node's button stayed held. The MCP loopback surface hit the same defect whenever its 30-second tool cache rebuilt. The mutable guard state (target/frame affinity, held-button target, input serialization queue) moves into an injectable ComputerToolInvocationState. The agent path is unchanged and keeps per-instance state. resolveGatewayScopedTools, the shared chokepoint behind all gateway tool surfaces, injects a per-session provider backed by a bounded registry: keyed by session key, 64-session LRU cap, 15-minute sliding TTL, entries created only when the computer tool executes. No tool instances are cached and state never crosses session keys. Closes openclaw#104113
13 tasks
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #103335
Related: #97333
Follow-up to #102776
AI-assisted with Codex; the maintainer reviewed and understands the changes.
What Problem This Solves
The initial macOS computer-use implementation could accept desktop input whose authority had become stale. A replaced screenshot, display reconnect, transport replay, route replacement, or cancellation race could duplicate an action, retarget screenshot coordinates, start queued work after revocation, or leave a synthetic mouse button held.
Why This Change Was Made
This hardens the full screenshot-to-input path instead of adding another approval layer:
frameId, physical display identity, geometry, screen index, and reference width;computer.actpolicy;/phone arm allfrom silently authorizing desktop control;/phone arm computerremains explicit and reload-safe.User Impact
Computer control remains off and disarmed by default. Once deliberately exposed and armed, coordinate input now fails closed when the model did not receive the exact screenshot, the physical display changed, the request was replayed, or the active node lifecycle lost authority. Cancellation and route replacement complete held-input cleanup before successor work is admitted.
No new config surface or protocol-version bump is introduced. Documentation covers tool policy, explicit arming, frame identity, persistent authorization, Codex direct-tool behavior, and troubleshooting; release-note context remains in this PR for release automation.
Evidence
check:changed(all selected lanes): leasetbx_01kx52gykb4dca2664gda48vy8/jade-prawn, succeeded in 4m30.529s. Typecheck, core/extension/script oxlint, runtime import cycles, generated guards, and repository policy guards were green.tbx_01kx58ewe7bkhck3pcy3kzwg51/violet-crab:nodes-utils.test.tspassed 5/5 and targeted oxfmt passed; the same AbortSignal is proven through both the current node list and legacy fallback.ComputerActionServiceTests,MacNodeModeCoordinatorTests,GatewayChannelDisconnectTests,GatewayConnectionControlTests, andMenuContentSmokeTestspassed. The cancellation regression delays the MainActor cleanup hop, makes the first mouse-up fail, and proves cancellation waits for a successful retry before settling.git diff --check; SwiftFormat andswiftc -parse; native i18n inventory (entries=2869 changed=false); docs map; targeted oxfmt/oxlint.spec_plan.rs:204-229,spec_plan.rs:450-510,tool_output.rs:223-243,dynamic.rs:150-213, andthread.rs:56-90; Mistral SDK omitted-index default at@mistralai/mistralai/src/models/components/toolcall.ts:34.Known evidence gap: a source-blind autonomous GUI run remains blocked because clawmac has no already-running isolated patched app plus isolated Gateway/port and safe test window; production
/Applications/OpenClaw.appand its Gateway were intentionally untouched. The validator reported 0 pass, 0 fail, 6 blocked. Closing that black-box loop requires a GUI/VNC session and isolated signed app runtime.No visual diff.