Skip to content

fix(ui): pairing decisions resend on double click and lack device names - #177571

Merged
vyctorbrzezowski merged 6 commits into
openclaw:mainfrom
etzelm:cui/5-device-approve-guard
Oct 22, 2026
Merged

vyctorbrzezowski merged 6 commits into
openclaw:mainfrom
etzelm:cui/5-device-approve-guard

Conversation

@etzelm

@etzelm etzelm commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #127580

What Problem This Solves

Approving or rejecting a pending device or node can send the same decision twice before the first response arrives, producing an unknown requestId error after a successful decision. Pending device controls also need to identify their device to screen readers.

User Impact

Only the request being approved or rejected is disabled while waiting. Other pending requests remain usable, and failures allow retry. Screen readers identify the device for each decision.

Why This Change Was Made

The pairing owner now admits one decision per request. Approve and Reject share that guard; other pending requests remain usable. Settlement releases the guard for retry. Connection and route retirement clear obsolete admission, while an old completion cannot release a newer decision for the same request. Device buttons expose names such as “Approve Synthetic tablet.” Confirmation-time permission and connection checks remain in the shared dialog owner.

The integration with current main preserves Mitchell Etzel's feature and original commit ancestry. Pairing uses the existing page-task owner instead of the inventory-wide saving indicator, so deciding on one row does not disable the other rows. Token rotation, revocation, removal and their existing presentation are unchanged.

Evidence

Inspected before/after screenshots and browser evidence show the real source UI with a simulated Gateway. Before is main b90f49b11fc; after is the reviewed candidate. The later main integration through c2abf601480 leaves the Devices sources and relevant captured styles unchanged.

  • Chromium: laptop pending, tablet still usable; both requests recorded. Simulated failures re-enable both rows and a retry sends a new request.
  • 50 focused tests passed across pairing operations, Devices rendering, dialogs and inventory actions. Existing reconnect/navigation failures reproduced before the repair and pass afterward. A regression also fails when stale completion releases a replacement request.
  • Single-file wall times using the supported node scripts/run-vitest.mjs <file> --maxWorkers=1 wrapper: pairing operations 3.14 s; Devices rendering 2.69 s; inventory actions 2.10 s. The wrapper avoids reconciling the shared dependency installation. Exact-head CI run 39785774744 passed. Its emitted module timings report 0.295 s of test execution for pairing operations and 0.770 s for inventory actions; these exclude worker setup and collection. The rendering file has the measured local wall time above; no per-file CI timing was emitted in the inspected UI logs.
  • Formatting and git diff --check passed. Independent P0–P2 review found no actionable defect.

Risk and coverage

This guard covers overlapping decisions in one page scope; it does not coordinate concurrent operators. The real Gateway was not exercised in this maintainer pass. Both source-browser runs logged the same entries is not iterable error outside the verified pairing interactions, so the capture is not a claim that the entire application is error-free.

Local lint was not completed: the repository wrapper rejected shared dependencies outside the checkout. Its guard was preserved; lint and type checks passed through the exact-head GitHub CI run. No full local build or test suite was run.

- Track in-flight approve and reject decisions per pending requestId for
  device and node pairing; a repeat decision for the same request sends
  nothing until the first one settles.
- Disable a pending device row's Approve and Reject, and a pending node's
  Approve and Reject menu items, while that request's decision is in flight.
- Name each pending device row's Approve and Reject after its device.
@clawsweeper

clawsweeper Bot commented Oct 19, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR suppresses overlapping pairing decisions and adds device names to pending-device buttons’ accessible labels.

Example: An operator double-clicks Approve for Synthetic laptop.

  • Before: Two approval requests can produce an unknown requestId error after approval succeeds.
  • After: One approval request is sent, and both decisions stay disabled while it is in flight.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with production-entry-point evidence, meaningful regressions, passing exact-head CI, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The built Control UI was exercised in Chromium against a real in-process Gateway, with recorded WebSocket results reducing duplicate approval frames from two to one and preserving pairing outcomes; inspected held-response screenshots and accessibility output support error removal and named disabled controls. Node-specific controls and failed-decision release have unit/view coverage rather than separate browser proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An operator can see an approval failure after pairing succeeded, and screen readers cannot distinguish pending-device decision buttons.
Reason: The patch addresses the demonstrated overlapping-decision defect and accessible naming using existing owners; its documented post-settlement and cross-client limits do not require broader machinery.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current pairing-feedback bug with a focused shared guard; no actionable correctness or security findings remain.

Priority: P2
Reviewed head: 8a4ba6b235148cf5e0d30b86d4e1fda8528c7496

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Devices page translates operator decisions into Gateway pairing RPCs and renders authoritative inventory, pending controls, and operation errors.

flowchart TD
  A[Operator decision] --> B[Devices page]
  B --> C[Per request decision guard]
  C --> D[Existing mutation owner]
  D --> E[Gateway pairing RPC]
  E --> F[Inventory refresh]
  F --> B
Loading

Technical review

Best possible solution:

Keep one synchronous request-level decision owner around the existing mutation flows and render its pending state in both device and node controls.

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

Yes: current-main dispatch permits repeated decisions, the Gateway rejects consumed request IDs, and the contributor supplies a matching real-Gateway browser trace; this review executed no target code.

Is this the best way to solve the issue?

The shared synchronous guard is a small complete repair for overlapping decisions, preserves genuine errors and existing refresh policies, and avoids unnecessary persisted state or competing owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4ab3748ad4d8.

Provenance checked

  • Device and node mutation dispatch changes intended behavior with a stated reason (97d5a08: The earlier refactor consolidated completion ownership while retaining captured-connection device settlement and current-inventory node refresh.)
  • Devices controls and native menu keeps the original intent (refactor(ui): use native menus for device actions #170784: The native-menu migration preserved action order, callbacks, and live pairing-permission checks.)
  • Pending-device rendering keeps the original intent (refactor(ui): fold private page rendering surfaces #177511: Private rendering was folded into its owning page without intended behavior changes; this PR moves the existing buttons together and adds only pending-state and accessible-name behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 97d5a08 adds ui/src/lib/nodes/page-operations.ts:226 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 97d5a0894be5; files: ui/src/lib/nodes/page-operations.ts)
  • Vincent Koc: Raw commit 43d4035 adds ui/src/lib/nodes/page-operations.ts:240 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 43d4035adbf6; files: ui/src/lib/nodes/page-operations.ts)

PR surface

Source +61, Tests +78. Total +139 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 82 21 +61
Tests 4 79 1 +78
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 161 22 +139

Root-cause cluster

Relationship: same_root_cause
Canonical: #127580
Summary: This PR repairs the canonical report’s unowned overlapping pairing decisions.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The repair prevents misleading failure feedback after successful pairing and improves accessible identification without changing pairing authority.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 2:27 PM ET / 18:27 UTC.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 19, 2026

@vyctorbrzezowski vyctorbrzezowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the shared device/node pairing guard, conflicting decisions for the same request, failure cleanup, connection and page replacement, confirmation-time permission checks, and the disabled controls and accessible device names. The guard acquires synchronously and releases in finally; the existing mutation and connection owners retain error and refresh behavior. No actionable issue found in the reviewed diff.

Automated code review complete. No further changes are requested from the author at this stage. Final product and design review will be handled by the responsible maintainer before the PR is considered for merge.

@vyctorbrzezowski vyctorbrzezowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the shared device/node pairing guard, conflicting decisions for the same request, failure cleanup, connection and page replacement, confirmation-time permission checks, and the disabled controls and accessible device names. The guard acquires synchronously and releases in finally; the existing mutation and connection owners retain error and refresh behavior. No actionable issue found in the reviewed diff.

Automated code review complete. No further changes are requested from the author at this stage. Final product and design review will be handled by the responsible maintainer before the PR is considered for merge.

@vyctorbrzezowski

Copy link
Copy Markdown
Member

Rechecked the Devices page in Chromium with two synthetic pending devices and a held Gateway response.

Before — main b90f49b11fcde5f994de83c8b4874a98a83c44ad: deciding on the laptop disables both pending rows.

Main: both pending rows disabled

After — reviewed candidate tree 8b3ad39470a0f058e1191ad1bce678478fc46ed2: only the laptop's Approve and Reject controls are disabled; the tablet remains usable. Both controls include the device name for assistive technology.

Candidate: only the deciding row disabled

The browser sent a second decision for the tablet while the laptop was pending. Rejecting the held responses re-enabled both rows; retrying the laptop sent the third request. Separate focused tests cover same-request duplicate suppression, opposite decisions, connection/route retirement, and stale completion versus a replacement decision (50 tests passed).

Full-page context, same viewport and fixtures:

Main full-page context

Candidate full-page context

Risk and coverage: this is the real source UI with a simulated Gateway, not a live operator session. The entire tracked source tree was verified equal to the pinned main commit before the first capture, then restored and verified against the reviewed candidate. Both runs logged the same entries is not iterable page error outside the verified pairing interactions; this capture does not establish an error-free full application run. No full build was run.

@openclaw-barnacle openclaw-barnacle Bot added size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 22, 2026
@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) October 22, 2026 13:23
@vyctorbrzezowski
vyctorbrzezowski merged commit f172da3 into openclaw:main Oct 22, 2026
109 of 112 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…es (openclaw#177571)

* fix(ui): pairing decisions resend on double click and lack device names

- Track in-flight approve and reject decisions per pending requestId for
  device and node pairing; a repeat decision for the same request sends
  nothing until the first one settles.
- Disable a pending device row's Approve and Reject, and a pending node's
  Approve and Reject menu items, while that request's decision is in flight.
- Name each pending device row's Approve and Reject after its device.

* chore: prepare reviewed contributor base integration

* fix(ui): preserve device decision guards across main integration

* fix(ui): retain per-request pairing guards across lifecycle changes

---------

Co-authored-by: Vyctor H. Brzezowski <[email protected]>
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

Duplicate pairing actions can render failure after approval succeeded

2 participants