Skip to content

refactor(ui): share pairing request flows - #147123

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/ui-pairing-request-flows-20260913
Sep 13, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/ui-pairing-request-flows-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Device and node pairing approval/rejection duplicate their request and refresh flows.

User Impact

Device responses remain fenced to the original client and request generation. Node pairing refreshes the current inventory on success or failure, with failure text retained after quiet refreshes.

Why This Change Was Made

One private async owner per pairing family retains all four public functions and their separate lifecycle policies. The public wrappers return each helper promise directly.

Production: −5 lines; tests: +183 lines. No RPC, permission, connection, dialog, queue or error-formatting policy changes.

Evidence

  • Normal CI34773071785, attempt1 passed at 85ce875af06df088f40b337ebc2593b18ff0808f: 88 successful jobs and 13 planned skips. The required aggregate gate passed. Tested merge 426f8e24d7b4cf43db5e2a3d977c70041a9a575f combines 201f11afefdb19a9c75e9d3542bf7425c80df7a7 and the reviewed head; both changed blobs match the reviewed source.
  • All 19 new public-operation cases passed in UI shard1, covering four RPCs, guards, stale device responses, node client replacement, deferred refreshes and queued loads. UI unit coverage passed 19,545 tests across 1,145 files with one skipped test; all seven UI E2E shards passed. The real-Gateway suite passed 57 cases across 28 files, including device-identity and alias-rename siblings; it does not establish live execution of all four pairing RPCs.
  • Selected build, production/test types, lint and formatting passed. UI performance measured 354,603 startup JavaScript gzip bytes against the 356,316-byte allowance. No isolated PR-versus-base JavaScript size effect is claimed.
  • Actual old/new owners matched 14,400 getter/write/request/settlement traces plus four independent RPC-order expectations. The full owner, real loaders and error formatter executed; request promises and the redactor were explicit seams. Reinlining reconstructs the entire original owner byte-for-byte.
  • Full owner, callers, queue/reconnect tests, Gateway request and error contracts, and lifecycle history were inspected. Root and independent source reviews, final P2, formatting and diff checks passed. The latest exact-head review, has no findings, Before merge items or Rank-up moves.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 15:11
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 5:49 PM ET / 21:49 UTC (Revision 5).

ClawSweeper review

What this changes

Shares approval and rejection handling within each Control UI pairing family while preserving their distinct refresh behavior and adding lifecycle coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, behavior-preserving cleanup that current main does not contain. No actionable introduced defects were found, and the previous review has no outstanding findings.

Priority: P3
Reviewed head: 85ce875af06df088f40b337ebc2593b18ff0808f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused refactor with useful lifecycle coverage, successful exact-head CI, and no identified correctness defects.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored refactor is exempt from external-contributor runtime proof, and no material authority change triggers additional proof. Focused operation tests and reported equivalence traces support preservation; the cited real-Gateway suite does not demonstrate all four pairing RPCs.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored refactor is exempt from external-contributor runtime proof, and no material authority change triggers additional proof. Focused operation tests and reported equivalence traces support preservation; the cited real-Gateway suite does not demonstrate all four pairing RPCs.
Evidence reviewed 7 items Introduced production change: The pinned introduction diff extracts two private async helpers. All four public operations retain their RPC method, parameters, connection checks, refresh policy, and error handling.
Current main and release still contain separate handlers: Current main retains duplicated approve/reject implementations. Inspection of the supplied latest-release commit also found all four separate async handlers; this cleanup is not already implemented there.
Public-operation lifecycle coverage: Read all 19 added cases covering RPC selection, unavailable connections, stale device outcomes, node client replacement, deferred refresh completion, and queued quiet refreshes. These exercise exported operations without exposing the private helpers.
Findings None None.
Security None None.

How this fits together

The Control UI Devices page sends pairing decisions to the Gateway and refreshes its device and node inventory. These operations connect page actions and confirmation dialogs to Gateway requests and displayed results.

flowchart TD
  A[Devices page actions] --> B[Permission and confirmation checks]
  B --> C[Device pairing operations]
  B --> D[Node pairing operations]
  C --> E[Gateway pairing requests]
  D --> E
  E --> F[Connection-scoped device refresh]
  E --> G[Current inventory refresh]
  F --> H[Inventory and error display]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests +183. Total +178 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 25 30 -5
Tests 1 183 0 +183
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 208 30 +178

Review metrics

None.

Technical review

Best possible solution:

Retain one private request owner per pairing family, preserving the existing public operations and their distinct lifecycle contracts.

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

Not applicable: this PR removes duplicated implementation rather than repairing a reported behavioral defect.

Is this the best way to solve the issue?

Yes: separate private helpers remove duplication without combining the device and node lifecycle policies or changing callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e45a8f47175.

Labels

Label justifications:

  • P3: This internal cleanup preserves existing pairing behavior and introduces no new user-facing capability.
  • 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: The MEMBER-authored refactor is exempt from external-contributor runtime proof, and no material authority change triggers additional proof. Focused operation tests and reported equivalence traces support preservation; the cited real-Gateway suite does not demonstrate all four pairing RPCs.

Evidence

What I checked:

  • Introduced production change: The pinned introduction diff extracts two private async helpers. All four public operations retain their RPC method, parameters, connection checks, refresh policy, and error handling. (ui/src/lib/nodes/page-operations.ts:215, 85ce875af06d)
  • Current main and release still contain separate handlers: Current main retains duplicated approve/reject implementations. Inspection of the supplied latest-release commit also found all four separate async handlers; this cleanup is not already implemented there. (ui/src/lib/nodes/page-operations.ts:215, 9e45a8f47175)
  • Public-operation lifecycle coverage: Read all 19 added cases covering RPC selection, unavailable connections, stale device outcomes, node client replacement, deferred refresh completion, and queued quiet refreshes. These exercise exported operations without exposing the private helpers. (ui/src/lib/nodes/pairing-operations.test.ts:22, 85ce875af06d)
  • Existing authority checks remain unchanged: Approval callers check pairing access; rejection dialogs revalidate connection, generation, and current access after confirmation. The introduced helpers do not change principals, authorization, persistence, or final RPC targets. (ui/src/pages/devices/devices-dialogs.ts:172, 85ce875af06d)
  • Exact-head CI and proof scope: GitHub confirms run 34773071785 completed successfully for the reviewed head. The captured PR body reports focused tests and equivalence traces, and expressly distinguishes its real-Gateway sibling coverage from live execution of all four pairing RPCs. No tests were executed during this read-only review. (85ce875af06d)
  • Historical routing: Local blame and GitHub path history connect the current owner file to steipete's merged UI work. GitHub reports this path added in the cited commit; earlier lineage was not established. A deeper local history traversal encountered an unavailable object, so no original-feature introduction claim is made. (ui/src/lib/nodes/page-operations.ts:225, 1ad9fe2a759d)

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-13T15:21:44.512Z sha ba748b6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T15:42:41.043Z sha ba748b6 :: blocked before merge. :: none
  • reviewed 2026-09-13T18:06:36.614Z sha 85ce875 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T18:28:42.077Z sha 85ce875 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the refactor/ui-pairing-request-flows-20260913 branch from ba748b6 to 85ce875 Compare September 13, 2026 17:55
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Refreshed head 85ce875 includes the landed Workboard awaited-cleanup fix landed via PR147203 and the prior UI-budget correction. Reviewed source/test blobs remain unchanged. Fresh P2 review passed; normal new-head CI is required. Please review this exact revision.

@clawsweeper

clawsweeper Bot commented Sep 13, 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:

@vincentkoc
vincentkoc merged commit 43d4035 into main Sep 13, 2026
139 of 141 checks passed
@vincentkoc
vincentkoc deleted the refactor/ui-pairing-request-flows-20260913 branch September 13, 2026 21:55
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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