Skip to content

fix(nodes): approve silent initial node surfaces and name the pending surface approval - #129795

Merged
steipete merged 2 commits into
mainfrom
steipete/fix-cidr-node-surface
Aug 26, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/fix-cidr-node-surface

Conversation

@steipete

@steipete steipete commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

#128446: a node whose device pairing is approved non-interactively (trusted-CIDR — and, as live reproduction showed, silent same-host pairing too) dead-ends: device paired, capability surface pending, and the node host retries node.runnerInventory.update every 5 seconds with node runner inventory publication is not current; retry after pairing completes — which misdescribes the state (device pairing DID complete) and names no way out.

Why This Change Was Made

  • The surface prompt is intentional for both routes and stays. Network origin (trusted-CIDR) must not approve a command surface (existing inline security comment), and gateway suites (server.roles-allowlist-update, server.node-pairing-rate-limit) protect the same contract for silent same-host pairing: a silently paired local device exposes no declared commands (system.run, canvas.snapshot, …) until an operator approves its surface. An earlier revision of this branch auto-approved silent surfaces; those suites correctly rejected it — auto-approval would hand privileged commands to any local process that pairs. SSH-verified pairing and node-profile setup codes keep their existing inline surface approval (machine-ownership proof / recorded admin consent).
  • The repair is at the message, for every route: when inventory publication lacks a pairing generation and the node has a pending surface, the rejection now reads node capability surface is awaiting operator approval; run \openclaw nodes approve ` (see `openclaw nodes pending`), then this node retries automatically`. The pending lookup runs only on this error path.
  • Docs: the autoApproveCidrs example now states the CIDR (and silent) routes approve the device only, the surface still needs openclaw nodes approve, and which routes approve the initial surface automatically and why.
  • The issue's "pending request invisible in openclaw nodes pending" claim did not reproduce on current main (pending entries list correctly in both shapes); recorded as a rig transient from the original report.

User Impact

Nodes paired via CIDR auto-approval or silent same-host pairing no longer spin on an unactionable retry: the node host log states exactly what to run, and approval heals the node without reconnect. No trust-model change.

Evidence

Live on a dev rig (isolated state dirs):

  • CIDR shape: LAN setup-code connect with autoApproveCidrs → device trusted-cidr, surface pending as designed, node log shows the new actionable message; running the exact printed command (openclaw nodes approve 87de0c4f-…) healed the node to session hosting (32/32 slots) without reconnect.
  • Silent shape: loopback setup-code connect reproduced the identical strand on unfixed main (approved_via=silent, surface pending, endless generic retries); the message path is route-agnostic, and openclaw nodes pending/approve was verified to list and heal it live.

Tests:

  • nodes.read.test.ts regression: inventory publication without a pairing generation and with a pending surface responds with the approve command (verified failing pre-fix for the intended reason).
  • server.node-pairing-auto-approve.test.ts (real-gateway LAN e2e) extended: CIDR pairing asserts approvedVia=trusted-cidr, no approved surface, and a defined pending surface — pinning the intentional manual prompt.
  • Full affected sweep green: roles-allowlist-update, node-pairing-rate-limit, auth default-token, nodes.read, node-pairing-auto-approve; pnpm check:changed green. Production LOC: +10/-2 (error-path lookup + message); tests +72; docs +8.

Fixes #128446

… approval

Silent same-host device pairing carries local-grade auth — the operator
themselves — but the inline initial-surface approval covered only
ssh-verified and bootstrap routes, so headless silent connects (which have
no approval UI to consume the silent hint) stranded the node: surface
pending forever, inventory publication retrying every 5s. The gate now uses
the existing deviceApprovedNonInteractively predicate. trusted-cidr stays on
the manual prompt (network origin must not approve a command surface), and
its dead end is repaired at the message: the inventory rejection names the
pending request and the exact openclaw nodes approve command. Docs state
what autoApproveCidrs does and does not approve.

Fixes #128446
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 26, 2026 02:53
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime plugin: file-transfer size: S maintainer Maintainer-authored PR labels Aug 26, 2026
… the repair

Reverts the silent-route inline surface approval: gateway suites
(roles-allowlist-update, node-pairing-rate-limit) protect the deliberate
contract that a silently paired local device exposes no declared commands
until an operator approves its surface — auto-approval would hand system.run
to any local process that pairs. The #128446 dead end is repaired for every
route by the actionable inventory rejection naming the pending request and
approve command; docs state the surface prompt applies to silent and
trusted-cidr device approvals alike.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 11:53 PM ET / August 26, 2026, 03:53 UTC.

ClawSweeper review

What this changes

The PR makes stalled node inventory publication name the matching pending surface approval command, documents manual surface approval for CIDR and silent pairing, and adds regression coverage.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-authored PR open for normal merge handling. Current main still gives the generic retry despite a pending capability surface; the PR supplies the missing operator recovery path without changing the approval boundary.

Priority: P2
Reviewed head: 107d26e6876789fa976b5c12d3c4419f7868da0a

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-backed, with a detailed reported live run, but current-main integration still needs an exact-head refresh.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: Not applicable: this is maintainer-authored; the PR body nevertheless records an isolated live gateway run and recovery after approval.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: this is maintainer-authored; the PR body nevertheless records an isolated live gateway run and recovery after approval.
Evidence reviewed 6 items Current-main behavior: Current main returns only the generic inventory retry when the connected session lacks a pairing generation; it does not identify a pending surface or approval command.
Proposed repair: The PR reads pending node pairings only on the existing retry path, matches the connected node ID, and returns its approval command; otherwise it preserves the prior generic retry.
Approval-boundary contract: The connect path deliberately excludes trusted-CIDR from noninteractive capability approval, while SSH-verified and bootstrap routes may approve an initial surface.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw nodes --help

Result: FAIL (failed) — step 1 run pnpm openclaw nodes --help: previous terminal command was still running after 30 seconds: "pnpm openclaw nodes --help"

$ node scripts/run-node.mjs nodes --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 112.39 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.4s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4307ms (slowest: built plugin control-plane loads 3529ms)
│

Assertions:

  • FAIL expect_output: Manage gateway-owned nodes
  • FAIL expect_output: approve

How this fits together

A node first completes device pairing, then its declared command surface is separately approved before it can publish runner inventory and host work. The gateway handles the inventory update and returns a retry response to the connected node when that surface remains pending.

flowchart LR
  A[Node connects] --> B[Device pairing]
  B --> C[Capability surface pending]
  C --> D[Inventory publication]
  D --> E[Gateway checks pairing generation]
  E --> F[Actionable approval response]
  F --> G[Operator approves surface]
  G --> H[Node hosts sessions]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports the branch as clean but behind current main; this checkout could not construct a local three-way merge because older promisor objects required unavailable network access, so rebase and exact-head CI refresh remain necessary before landing.
  • Complete next step (P2) - No repair lane is needed because the patch has no concrete review finding; the remaining action is normal maintainer integration after a current-main refresh.
Agent review details

Security

None.

PR surface

Source +8, Tests +68, Docs +6. Total +82 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 2 +8
Tests 2 70 2 +68
Docs 1 7 1 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 87 5 +82

Review metrics

Metric Value Why it matters
Production versus test delta production +10/-2 (net +8), tests +70/-2 (net +68), docs +7/-1 (net +6) The small production increase is the state lookup and actionable response on an existing error path; tests and docs pin the manual-approval contract.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the separate device and capability approvals, land the localized actionable retry response after an exact-head rebase/check refresh, and preserve the CIDR and silent manual-surface tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the separate device and capability approvals, land the localized actionable retry response after an exact-head rebase/check refresh, and preserve the CIDR and silent manual-surface tests.

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

Yes—source establishes the path: an absent pairing generation takes the generic retry branch, while a persisted pending surface has a canonical request ID; the PR body also provides a concrete isolated-gateway scenario.

Is this the best way to solve the issue?

Yes. The response-layer lookup fixes the missing operator guidance while preserving the pairing owner’s intentional manual capability approval; auto-approving CIDR or silent surfaces would violate the existing trust contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a bounded node workflow that otherwise retries indefinitely without an operator-visible recovery action.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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: Not applicable: this is maintainer-authored; the PR body nevertheless records an isolated live gateway run and recovery after approval.

Label justifications:

  • P2: This repairs a bounded node workflow that otherwise retries indefinitely without an operator-visible recovery action.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: this is maintainer-authored; the PR body nevertheless records an isolated live gateway run and recovery after approval.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame and the available recent node/worker history attribute the central code to Peter Steinberger; this PR also follows the same pairing-owner boundary. (role: current surface owner and recent contributor; confidence: high; commits: 107d26e68767, efaa867d934c, f44759073b3c; files: src/gateway/server-methods/nodes.read.ts, src/gateway/server/ws-connection/connect-node-session.ts, src/infra/device-pairing-node.ts)
  • sahilsatralkar: The available trusted-CIDR feature commit credits this person, making them a historical routing contact for that pairing route. (role: credited contributor on the original CIDR feature; confidence: medium; commits: f44759073b3c; files: src/gateway/node-pairing-auto-approve.ts)

Rank-up moves

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

  • Rebase onto current main and refresh the exact-head check set before merge.

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.

@steipete
steipete merged commit 9872419 into main Aug 26, 2026
211 checks passed
@steipete
steipete deleted the steipete/fix-cidr-node-surface branch August 26, 2026 04:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
… surface approval (openclaw#129795)

* fix(nodes): approve silent initial node surfaces and name the pending approval

Silent same-host device pairing carries local-grade auth — the operator
themselves — but the inline initial-surface approval covered only
ssh-verified and bootstrap routes, so headless silent connects (which have
no approval UI to consume the silent hint) stranded the node: surface
pending forever, inventory publication retrying every 5s. The gate now uses
the existing deviceApprovedNonInteractively predicate. trusted-cidr stays on
the manual prompt (network origin must not approve a command surface), and
its dead end is repaired at the message: the inventory rejection names the
pending request and the exact openclaw nodes approve command. Docs state
what autoApproveCidrs does and does not approve.

Fixes openclaw#128446

* fix(nodes): keep silent surfaces on the manual prompt; the message is the repair

Reverts the silent-route inline surface approval: gateway suites
(roles-allowlist-update, node-pairing-rate-limit) protect the deliberate
contract that a silently paired local device exposes no declared commands
until an operator approves its surface — auto-approval would hand system.run
to any local process that pairs. The openclaw#128446 dead end is repaired for every
route by the actionable inventory rejection naming the pending request and
approve command; docs state the surface prompt applies to silent and
trusted-cidr device approvals alike.
vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (24 commits)
  fix(gateway): reject rootless session permission modes (#128149)
  docs(memory): document shipped turn-taint propagation for network tool output (#129837)
  fix(ui): pool reply-less wake activity into one chat rollup (#128442)
  fix(package): prevent installs from deleting validated runtime assets (#129724)
  fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795)
  fix(backup): preserve configured agent state roots (#129773)
  fix(ui): own chat history issuance with a closed state machine (#129776)
  fix(cron): preserve cancellation reason after late finalization (#129331)
  fix(cron): prevent run waits from failing after clock changes (#129805)
  fix(telegram): route commentary through one frozen progress owner (#128259)
  fix(release): start approved VCR mirror recovery jobs (#129829)
  test: complete current-plugin-metadata-snapshot mock factories (#129791)
  test(telegram): remove duplicate reaction case (#129848)
  fix(channels): honor supported account reply-threading policies (#129679)
  refactor(cli): deduplicate lazy subcommand registration (#129351)
  fix(ai): report interrupted local-model streams instead of empty success (#129794)
  refactor(cli): consolidate Gateway fallback and hook ownership (#129802)
  fix(qa): reject token confidence lanes without executed evidence (#129830)
  fix(tui): fence session state and delayed actions (#129810)
  fix(control-ui): keep task progress full width on hover (#129832)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

CIDR-auto-approved node pairing strands the node surface pending and invisible; inventory publication retries forever

1 participant