Skip to content

fix(nodes): preserve operator rename during reapproval - #117608

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-node-reapproval-20260801
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-node-reapproval-20260801

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #117607

What Problem This Solves

Fixes an issue where operators who renamed a paired node would lose that stable label when approving a later capability or command-surface change from the same node.

Why This Change Was Made

Node reapproval now refreshes the node-declared capability surface while retaining the existing approved display name. The pending client-reported name remains the fallback for first approval, so initial pairing behavior is unchanged.

User Impact

Names assigned with openclaw nodes rename now survive node capability reapproval. Operators can keep stable inventory labels even when a client reports a different machine name during an upgrade or reconnect.

Evidence

  • Current-main source reproduction: node.rename writes the approved nodeSurface.displayName, but approveNodePairing previously replaced the whole surface with pending.displayName on every reapproval.
  • Exact-head real behavior proof on d352beed78690bfac4eadb22960bb4d602f6111d: an isolated Gateway and real headless node used separate temporary state and port 21467 (never the operator Gateway or port 18789). The node was first approved as Reported iPad, renamed through openclaw nodes rename to Living Room iPad, then reconnected as Reported iPad (updated) with installed-app sharing enabled to force a capability reapproval. Before approval, nodes pending --json showed the new device.apps command while nodes status --json retained Living Room iPad with pending-reapproval. After nodes approve, status still showed Living Room iPad, included device.apps, reported approvalState: approved, and nodes pending --json returned []. The owned node and Gateway then shut down cleanly and the isolated port closed.
  • Focused Blacksmith Testbox run https://github.com/openclaw/openclaw/actions/runs/30715621692 passed 18/18 node-pairing cases, including the operator rename, capability refresh, pending cleanup, and pairing-generation rotation. The workflow reports cancelled only because the externally stopped kept Testbox cancels its keepalive job after the remote command exits.
  • Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/30715914147 completed successfully, including openclaw/ci-gate.
  • Targeted formatting, oxlint, and git diff --check passed.
  • Final post-rebase P1 Codex autoreview and TruffleHog were clean with no accepted/actionable findings at 0.94 confidence. A fresh current-main Codex autoreview after the real lifecycle proof was also clean with no findings at 0.99 confidence.
  • Production delta: +2/-1; tests: +38/-4.

Release-note context: paired node rename overrides now remain stable across capability reapproval.

AI-assisted: yes. The state ownership and public node-rename contract were independently reviewed, and the final branch was remotely tested, exercised through the real CLI/Gateway/node lifecycle, and autoreviewed.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete
steipete marked this pull request as ready for review August 1, 2026 19:57
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 4:20 PM ET / 20:20 UTC.

ClawSweeper review

What this changes

The PR keeps an operator-assigned paired-node display name during capability reapproval while refreshing the node-reported command and capability surface.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

This PR remains necessary: current main still replaces the approved node-surface name with the pending client-reported name on every reapproval. The branch fixes that owner-boundary violation, includes focused regression coverage, and supplies convincing exact-head lifecycle proof; the protected maintainer label and active assignment leave final landing to normal maintainer review.

Priority: P2
Reviewed head: d352beed78690bfac4eadb22960bb4d602f6111d

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-boundary repair with strong lifecycle proof, regression coverage, and no actionable correctness or security finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR supplies an exact-head isolated Gateway and headless-node lifecycle transcript with before/after CLI state, capability refresh, pending cleanup, and clean shutdown, supported by successful Real behavior proof checks.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies an exact-head isolated Gateway and headless-node lifecycle transcript with before/after CLI state, capability refresh, pending cleanup, and clean shutdown, supported by successful Real behavior proof checks.
Evidence reviewed 6 items Current-main defect: Current main rebuilds the approved node surface during approval with displayName: pending.displayName, so a pending reapproval overwrites the prior operator-facing label.
Owner-boundary contract: The paired-node projection explicitly defines the surface name as operator-facing and says reconnect metadata refreshes only the device name; preserving the existing approved surface name is therefore the narrow canonical repair.
Proposed repair: The branch keeps device.nodeSurface.displayName when an approved surface already exists and uses the pending name only for first approval; the same assignment still refreshes the reported capability fields.
Findings None None.
Security None None.

How this fits together

A paired node submits a reported name and capability surface to the Gateway for approval. The Gateway stores the approved surface for CLI status and selection, while openclaw nodes rename lets an operator assign a stable inventory label.

flowchart LR
  A[Paired node reconnect] --> B[Pending reported name and capabilities]
  B --> C[Gateway reapproval]
  D[Operator node rename] --> E[Approved inventory label]
  C --> F[Refresh approved node surface]
  E --> F
  F --> G[CLI node status and selection]
Loading

Before merge

  • Complete next step (P2) - No mechanical repair remains; the protected maintainer label and active assignment require the normal maintainer merge decision.
Agent review details

Security

None.

PR surface

Source +1, Tests +34. Total +35 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 38 4 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 40 5 +35

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/infra/node-pairing.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #117607
Summary: This PR is the open candidate fix for the canonical paired-node reapproval display-name bug.

Members:

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

Technical review

Best possible solution:

Retain the operator-owned approved display name while updating the pending node-reported capability surface, then land the focused repair through normal maintainer merge review.

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

Yes, from source: current main stores an operator rename in the approved node surface and then replaces that field with the pending client name during capability approval. The PR’s exact-head lifecycle transcript independently covers the repaired CLI and Gateway sequence.

Is this the best way to solve the issue?

Yes. Preserving the existing approved-surface label at the approval owner is the narrowest fix and matches the nearby contract that reconnect metadata must not replace the operator-facing surface name.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies an exact-head isolated Gateway and headless-node lifecycle transcript with before/after CLI state, capability refresh, pending cleanup, and clean shutdown, supported by successful Real behavior proof checks.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦪 silver shellfish.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This is a deterministic paired-node inventory-label regression that affects reapproval users but does not disrupt node connectivity or message delivery.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Sufficient (live_output): The PR supplies an exact-head isolated Gateway and headless-node lifecycle transcript with before/after CLI state, capability refresh, pending cleanup, and clean shutdown, supported by successful Real behavior proof checks.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies an exact-head isolated Gateway and headless-node lifecycle transcript with before/after CLI state, capability refresh, pending cleanup, and clean shutdown, supported by successful Real behavior proof checks.

Evidence

What I checked:

  • Current-main defect: Current main rebuilds the approved node surface during approval with displayName: pending.displayName, so a pending reapproval overwrites the prior operator-facing label. (src/infra/node-pairing.ts:572, db49a9a565f8)
  • Owner-boundary contract: The paired-node projection explicitly defines the surface name as operator-facing and says reconnect metadata refreshes only the device name; preserving the existing approved surface name is therefore the narrow canonical repair. (src/infra/node-pairing.ts:176, d352beed7869)
  • Proposed repair: The branch keeps device.nodeSurface.displayName when an approved surface already exists and uses the pending name only for first approval; the same assignment still refreshes the reported capability fields. (src/infra/node-pairing.ts:572, d352beed7869)
  • Regression coverage: The focused test creates a pending capability change with an updated reported name, applies an operator rename, approves the request, and asserts both the preserved label and refreshed commands, pending cleanup, and pairing-generation rotation. (src/infra/node-pairing.test.ts:787, d352beed7869)
  • Behavior proof and checks: The PR body records an isolated exact-head Gateway/node lifecycle covering rename, capability reapproval, status retention, pending cleanup, and clean shutdown; the supplied check context also records successful exact-head Real behavior proof and openclaw/ci-gate runs. (d352beed7869)
  • History and current-main status: Blame attributes the current approval and rename functions to the current checked-out history boundary; the proposed commit is not an ancestor of current main, so this behavior is not implemented on main or in the stated latest release. (src/infra/node-pairing.ts:543, 11239da88fbe)

Likely related people:

  • steipete: The proposed branch is authored by steipete, and local shortlog history records the strongest contribution volume across the node-pairing implementation and tests. (role: feature-area contributor; confidence: high; commits: d352beed7869; files: src/infra/node-pairing.ts, src/infra/node-pairing.test.ts)
  • Vincent Koc: Current-main blame attributes the approval and rename implementation lines to the available history boundary commit; older provenance is obscured by the partial checkout. (role: recent current-main contributor; confidence: medium; commits: 11239da88fbe; files: src/infra/node-pairing.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-01T20:03:06.993Z sha d352bee :: needs real behavior proof before merge. :: none

@steipete steipete self-assigned this Aug 1, 2026
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready evidence for d352beed78690bfac4eadb22960bb4d602f6111d.

The approval owner rebuilt the full approved node surface from pending client metadata, which silently overwrote the operator-owned name written by node.rename. The fix keeps that one authoritative approved name while refreshing the client-declared capability fields. Initial approval still falls back to the pending name. Production delta is +2/-1; no alternate path or compatibility shim was added.

Real behavior proof used separate temporary Gateway and node state plus port 21467; it never touched the operator Gateway, state, or port 18789. The exercised command sequence was:

openclaw gateway run --allow-unconfigured --port 21467 --auth token --token <test-token> --bind loopback
openclaw node run --host 127.0.0.1 --port 21467 --display-name "Reported iPad" --no-share-installed-apps
openclaw nodes approve <initial-request> --url ws://127.0.0.1:21467 --token <test-token> --json
openclaw nodes rename --node <node-id> --name "Living Room iPad" --url ws://127.0.0.1:21467 --token <test-token> --json
openclaw node run --host 127.0.0.1 --port 21467 --display-name "Reported iPad (updated)" --share-installed-apps
openclaw nodes pending/status/approve ... --url ws://127.0.0.1:21467 --token <test-token> --json

Before reapproval, pending output contained the client-reported Reported iPad (updated) plus the new device.apps command, while status retained Living Room iPad with pending-reapproval. After approval, status still retained Living Room iPad, included device.apps, and reported approvalState: approved; pending output was []. Both owned processes shut down cleanly, the port closed, and the temporary state was moved to Trash.

Proof completed:

The latest ClawSweeper rank-up moves are complete: real lifecycle output is recorded and the PR body is updated. No proof gaps remain.

@steipete
steipete merged commit fb3d473 into main Aug 1, 2026
197 of 203 checks passed
@steipete
steipete deleted the codex/autoqa-node-reapproval-20260801 branch August 1, 2026 20:29
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Node capability reapproval overwrites operator rename

1 participant