Skip to content

fix(computer-use): macOS live-proof rig deadlocks on operator device approval - #124536

Merged
steipete merged 2 commits into
mainfrom
steipete/hungry-haslett-b5584b
Aug 16, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/hungry-haslett-b5584b

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where maintainers following the documented macOS computer-use live-proof rig in docs/nodes/computer-use.md could not complete it headlessly. The proof step failed with NOT_PAIRED / scope upgrade pending approval, and the documented escape hatch (openclaw --profile <profile> devices approve <requestId>) was circular: that CLI invocation is its own new device identity, so it needed an approval of its own. Only the isolated app held operator.admin, and its approval surface is a settings UI, so the flow was not headless as documented.

The same change fixes a second, wider problem: openclaw nodes list silently lost the connected view. On any gateway where the CLI must pair a device, the unfiltered list dropped connected, commands, and computerUse without saying why, and nodes list --connected failed outright — so the rig's documented "rerun nodes until the node is connected and advertises a computerUse descriptor" gate could not be satisfied.

Why This Change Was Made

A paired operator device is pinned to the scopes of its first connect, and widening them later is a scope upgrade the gateway never approves silently. The rig ran its operator CLI and its proof runner from one OPENCLAW_STATE_DIR, so they shared one device identity: nodes list connected first for node.pair.list (operator.pairing) and pinned it, after which the proof runner's operator.write request was an unapprovable upgrade.

No wider scope grant is needed to fix it. The proof runner and nodes approve connect as GATEWAY_CLIENT/BACKEND clients, and shouldSkipLocalBackendSelfPairing admits an unpaired loopback backend on auth.mode: "none" with exactly the scopes it declares, creating no pairing row at all. So the rig now gives the CLI its own cli-state identity and leaves agent-state to the backend clients — an ownership split, not a privilege increase.

Separately, nodes list read node.list through the plain CLI client while nodes status and nodes describe already used the diagnostics ladder (callNodeDiagnosticsGatewayCli, which falls back to a device-less local-backend read). Both nodes list call sites now use the same ladder, so one command no longer degrades where its siblings work.

Non-goal: this does not change gateway connect authorization. A related asymmetry — a narrowly paired device also caps a local backend client that would otherwise skip pairing, which can affect the gateway's own agent tool path on an auth.mode: "none" install — is left for a separate owner decision.

User Impact

Maintainers can run the macOS computer-use live rig end to end without any device-approval detour or UI interaction. openclaw nodes list now reports connected nodes, their commands, and their computerUse descriptor on gateways where the CLI must pair, instead of quietly returning pairing-only data, and nodes list --connected no longer fails there.

Evidence

Live, against an isolated gateway (auth.mode: "none", loopback, own OPENCLAW_STATE_DIR, never the operator's :18789), driving the real rig script:

Reproduction of the reported failure — the CLI pairs the shared identity narrowly, then every wider client is locked out:

$ openclaw nodes list --json          # fresh state dir
gateway connect failed: GatewayClientRequestError: scope upgrade pending approval (requestId: f29afe58-...)
$ sqlite3 <gateway-state>/state/openclaw.sqlite 'select client_id, scopes_json from device_pairing_paired;'
cli|["operator.pairing"]

After the split, with a real node connected, the rig completes headlessly:

  • rig nodes returns the merged view with connected: true, the node's commands, and .pending[0].requestId.
  • rig approve <id> succeeds unattended (it needs operator.pairing + operator.admin).
  • rig proof now reaches its own assertion — expected exactly one connected computer node, found 0 on this headless host — instead of failing at the gateway.
  • A direct node.invoke probe from agent-state returns a params-validation error, proving operator.write was granted.
  • Re-running the CLI from agent-state reintroduces scope upgrade pending approval at the proof step, confirming the causal link.

Tests: new src/cli/program.nodes-diagnostics-auth.e2e.test.ts covers both nodes list variants reading through the diagnostics ladder. Verified failing before the fix (unfiltered lost the node; --connected exited 1) and passing after. 31 tests green across program.nodes-basic.e2e.test.ts + the new file; oxlint and the core.test.config-cli tsgo shard clean.

Production LOC: +2/-2 in src/cli/nodes-cli/register.status.ts, +11/-2 in the dev rig script (mostly an invariant comment). Tests: +277/-195, almost entirely a move — the diagnostics-auth group was extracted into its own file because the basic file was at its max-lines cap.

Not verified here: the full signed-app rig run for both peekaboo and cua needs a desktop session with Accessibility/Screen Recording grants and input injection into a fixture window; the maintainer is running that separately.

The rig ran its operator CLI and its proof runner from one state dir, so both
shared one device identity. A paired operator device is pinned to the scopes of
its first connect, and `nodes list` connects first for `node.pair.list`
(operator.pairing); the proof runner then needs operator.write, which is a scope
upgrade the gateway never approves silently and which no rig client can approve
for itself. The proof runner is a GATEWAY_CLIENT/BACKEND client, so on a
loopback auth-none gateway it is admitted unpaired with the scopes it asks for:
giving the CLI its own `cli-state` identity is enough, and `agent-state` now
never accumulates a pairing row.

`nodes list` also read `node.list` through the plain CLI client while
`nodes status`/`describe` used the diagnostics ladder. On any gateway where the
CLI must pair, the unfiltered list silently dropped connected/commands/
computerUse and `--connected` failed outright, so the documented rig gate could
not confirm the node. Both call sites now use `callNodeDiagnosticsGatewayCli`.

Docs drop the `devices approve <requestId>` instruction, which was circular:
that invocation is its own new device identity.
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 11:08
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 7:16 AM ET / 11:16 UTC.

ClawSweeper review

What this changes

The PR separates the computer-use rig’s CLI and proof-client state directories and makes both nodes list paths use the existing diagnostics authentication ladder.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: the change follows the existing diagnostics-auth path used by sibling node commands and targets a source-supported failure, but the maintainer-labeled PR still needs exact-head CI and auth-matrix review.

Priority: P2
Reviewed head: 952b27600b37980ea31a5b0e5bf74465cce1a10d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The proposed fix is well aligned with current sibling behavior, with remaining confidence concentrated in exact-head validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless reports an isolated after-fix Gateway run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless reports an isolated after-fix Gateway run.
Evidence reviewed 6 items Current list path: Current main uses the plain CLI RPC for unfiltered effective-node reads, while the PR changes this call site to the diagnostics helper.
Existing canonical fallback: The diagnostics helper first tries stored device auth, then a constrained local backend client, then the ordinary CLI path; nodes status and nodes describe already use it.
Backend boundary: The Gateway admits a device-less backend only when it is a local backend client; auth-none is explicitly limited to that local path.
Findings None None.
Security None None.

How this fits together

The macOS computer-use rig launches an isolated Gateway, app node, CLI, and proof runner. The CLI reads pairing and connected-node state, while the proof runner invokes the selected computer-use node through the Gateway.

flowchart LR
  A[Computer-use rig command] --> B[CLI state directory]
  A --> C[Proof client state directory]
  B --> D[Gateway pairing and diagnostics]
  C --> D
  D --> E[Connected node details]
  D --> F[Computer-use proof result]
Loading

Before merge

  • Resolve merge risk (P2) - nodes list will now try stored-device and local-backend diagnostics authentication before its existing CLI fallback, so the exact head should be checked on auth-none loopback and explicit token/remote configurations.
  • Resolve merge risk (P1) - The executable rig changes are net +5 lines; that growth is justified by the separate state-owner boundary, but should not grow into another authentication path.
  • Resolve merge risk (P1) - The read-only promisor checkout could not hydrate the full PR tree and GitHub DNS was unavailable, so the added test source, failed CI-gate logs, and latest automated comment could not be independently inspected.
  • Complete next step (P2) - Protected maintainer work needs exact-head CI and authentication-matrix confirmation; no narrow automated repair is established.
Agent review details

Security

None.

PR surface

Source 0, Tests +82, Docs +2, Other +5. Total +89 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 2 277 195 +82
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 9 4 +5
Total 5 291 202 +89

Review metrics

Metric Value Why it matters
Production versus test LOC executable +11/-6, docs +3/-1, tests +277/-195 (195 lines moved) The net +5 executable lines establish separate state ownership; most test churn is relocation plus focused diagnostics coverage.

Merge-risk options

Maintainer options:

  1. Confirm the diagnostics auth matrix (recommended)
    Before merge, verify the current head preserves nodes list fallback behavior for auth-none loopback and explicit token or remote Gateway targets.
  2. Accept scoped diagnostics risk
    Merge with the existing sibling-helper coverage if maintainers accept the remaining exact-head validation gap.

Technical review

Best possible solution:

Keep one diagnostics ladder for both list flows, preserve the separate CLI and proof-client identities, and validate the current head across the local and remote authentication paths before merge.

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

Yes, from source and the submitted isolated-gateway trace: current main bypasses the diagnostics ladder for both list reads, while sibling commands use it. This read-only review did not run the signed-app rig.

Is this the best way to solve the issue?

Yes, provisionally: reusing the existing diagnostics ladder is cleaner than adding a rig-only authorization exception or a second fallback path. Exact-head auth-matrix validation remains necessary.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a documented maintainer rig and a node-list diagnostics failure with limited end-user blast radius.
  • add merge-risk: 🚨 auth-provider: The list command changes device-auth and local-backend fallback selection before its ordinary CLI connection path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless reports an isolated after-fix Gateway run.

Label justifications:

  • P2: This repairs a documented maintainer rig and a node-list diagnostics failure with limited end-user blast radius.
  • merge-risk: 🚨 auth-provider: The list command changes device-auth and local-backend fallback selection before its ordinary CLI connection path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless reports an isolated after-fix Gateway run.

Evidence

What I checked:

  • Current list path: Current main uses the plain CLI RPC for unfiltered effective-node reads, while the PR changes this call site to the diagnostics helper. (src/cli/nodes-cli/register.status.ts:232, 0c546979b2ac)
  • Existing canonical fallback: The diagnostics helper first tries stored device auth, then a constrained local backend client, then the ordinary CLI path; nodes status and nodes describe already use it. (src/cli/nodes-cli/rpc.ts:128, 3f3256906690)
  • Backend boundary: The Gateway admits a device-less backend only when it is a local backend client; auth-none is explicitly limited to that local path. (src/gateway/server/ws-connection/handshake-auth-helpers.ts:275, 3f3256906690)
  • Existing test surface: Current CLI program tests cover unfiltered and filtered nodes list behavior, giving the PR a suitable owner-boundary regression location. (src/cli/program.nodes-basic.e2e.test.ts:96, 0c546979b2ac)
  • Reported live proof: The PR body records an isolated auth-none Gateway run that reaches the proof assertion after the state split and reports the restored connected-node view. (952b27600b37)
  • Release status: The proposed head is not contained by any locally available tag; it is not part of the supplied latest release. (952b27600b37)

Likely related people:

  • Vincent Koc: Current-main blame attributes the diagnostics helper, list call site, and local-backend pairing guard to the same available history boundary; deeper history was unavailable in this sparse checkout. (role: current CLI and Gateway-auth lineage contributor; confidence: medium; commits: 3f3256906690; files: src/cli/nodes-cli/register.status.ts, src/cli/nodes-cli/rpc.ts, src/gateway/server/ws-connection/handshake-auth-helpers.ts)

Rank-up moves

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

  • Resolve or rerun the failed exact-head CI gate.
  • Record the signed-app results for both requested computer-use providers when available.

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.

The extracted diagnostics-auth file stringified captured log arguments directly, which the type-aware core lint stripe rejects (no-base-to-string). Move the existing formatter into the shared node test helpers instead of duplicating it.
@steipete
steipete merged commit b07c6b2 into main Aug 16, 2026
188 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the steipete/hungry-haslett-b5584b branch August 16, 2026 11:25
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
…approval (openclaw#124536)

* fix(computer-use): unblock the macOS live-rig proof flow

The rig ran its operator CLI and its proof runner from one state dir, so both
shared one device identity. A paired operator device is pinned to the scopes of
its first connect, and `nodes list` connects first for `node.pair.list`
(operator.pairing); the proof runner then needs operator.write, which is a scope
upgrade the gateway never approves silently and which no rig client can approve
for itself. The proof runner is a GATEWAY_CLIENT/BACKEND client, so on a
loopback auth-none gateway it is admitted unpaired with the scopes it asks for:
giving the CLI its own `cli-state` identity is enough, and `agent-state` now
never accumulates a pairing row.

`nodes list` also read `node.list` through the plain CLI client while
`nodes status`/`describe` used the diagnostics ladder. On any gateway where the
CLI must pair, the unfiltered list silently dropped connected/commands/
computerUse and `--connected` failed outright, so the documented rig gate could
not confirm the node. Both call sites now use `callNodeDiagnosticsGatewayCli`.

Docs drop the `devices approve <requestId>` instruction, which was circular:
that invocation is its own new device identity.

* test(cli): share the runtime-log formatter across nodes CLI e2e files

The extracted diagnostics-auth file stringified captured log arguments directly, which the type-aware core lint stripe rejects (no-base-to-string). Move the existing formatter into the shared node test helpers instead of duplicating it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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.

1 participant