Skip to content

fix(ui): refresh mixed-role node status - #126677

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-164-mixed-role-node
Aug 20, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-164-mixed-role-node

Conversation

@steipete

@steipete steipete commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #126675

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where operators viewing Settings → Devices would see a mixed-role Windows node remain online and miss its manual-wake warning when the node session disconnects while an operator session on the same device remains connected.

Why This Change Was Made

The Gateway intentionally maintains separate node and operator presence rows, while device pairing reports whether any role is connected and node inventory reports whether its node runtime is connected. The Devices page collapsed both presence rows into one device-only connectivity signature, so an unchanged connected operator masked the node disconnect. Distinguishing node-role presence inside the existing UI-owned signature restores the existing coalesced inventory refresh without changing Gateway behavior, protocol, configuration, persistence, security, product policy, polling, or the renderer.

User Impact

Node disconnects and reconnects immediately update the Devices inventory. A disconnected Windows node now shows offline and manual wake required even when another connection keeps its paired device connected; ordinary presence timestamps and activity updates still do not cause unnecessary requests.

Evidence

Real source-mode Control UI + real isolated loopback development Gateway + clean-profile Chromium, with only synthetic device identities:

  • Before: the genuine node disconnect event reached the browser, the Gateway returned node.list.connected=false and device.pair.list.connected=true, but browser node.list requests stayed at 1 → 1 and the offline/manual-wake badges were absent.
  • After: the same producer-side disconnect immediately changed browser node.list requests to 1 → 2 and displayed both offline and manual wake required while aggregate device connectivity remained connected.
  • Screenshots were inspected for personal data, tokens, network addresses, real hosts, and real devices before upload.

Before

Before: the synthetic Windows node remains visually online after its node session disconnects

After

After: the synthetic Windows node immediately shows offline and manual wake required

Focused tests, including the existing mixed-role offline/manual-wake renderer and inventory contracts:

OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=.artifacts/autoqa-164/vitest-cache node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/pages/devices/devices-page.test.ts ui/src/pages/devices/view.devices.test.ts ui/src/lib/nodes/inventory.test.ts

Result: 75 passing tests, covering node/operator disconnect and reconnect, missing/empty/merged role arrays, activity-only suppression, existing refresh coalescing, and mixed-role Windows rendering.

node scripts/check-changed.mjs -- ui/src/pages/devices/devices-page.ts ui/src/pages/devices/devices-page.test.ts
OPENCLAW_BUILD_ALL_NO_PNPM=1 node scripts/ui.js build --configLoader runner
git diff --check

The changed gate covers formatting, UI/core-test typechecks, targeted lint, i18n, and repository ownership guards. The UI build also verifies compressed sidecars and performance budgets. Fresh Codex-backed P1 autoreview and a separate independent adversarial review reported no actionable findings.

Production LOC: +2/-1 (net +1). Tests: +161/-0. Risk: low; UI-owned presence invalidation only. Follow-up outside this focused repair: inspect the separate New Session placement presence signature for the same mixed-role collision.

AI-assisted: yes

@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for #126675 at reviewed head 70fb08bad05eaffad4105f490330244e91d9d714.

The Devices page previously collapsed role-specific presence rows under a single device ID, so a connected operator overwrote a disconnected node and suppressed the existing inventory refresh. The canonical owner-boundary fix gives the already-present node role its own signature key. Gateway connectivity semantics, protocol, polling, configuration, renderer, and persistence are unchanged.

Real source Control UI + an isolated dev Gateway + a synthetic paired mixed-role device:

  • Before: disconnecting only the node emitted its real Gateway presence event, but browser node.list requests stayed 1 -> 1, leaving the node online.
  • After: the same transition immediately increased requests 1 -> 2 and displayed offline and manual wake required while the operator/device remained connected.
  • Inspected synthetic-only screenshots: before, after.

Verification:

  • Focused Control UI suite: 3 files, 75 tests passed; pre-fix regression failed as expected, including node disconnect/reconnect, accepted role-array shapes, activity-only suppression, inventory, and offline/manual-wake rendering.
  • Full changed gate: node scripts/check-changed.mjs -- ui/src/pages/devices/devices-page.ts ui/src/pages/devices/devices-page.test.ts.
  • Control UI build: OPENCLAW_BUILD_ALL_NO_PNPM=1 node scripts/ui.js build --configLoader runner; 922 sidecars and performance budgets passed.
  • Fresh P1 Codex-backed autoreview: clean. Separate independent adversarial final-diff review: no actionable findings.
  • Production LOC: +2/-1 (net +1); tests: +161/-0; git diff --check: clean.
  • Exact-head required CI: green, attempt 2 (run); attempt 1 had an unrelated New Session cloud-startup browser timeout, the exact failing suite independently passed 3/3 locally, and only failed jobs were rerun on the unchanged head.
  • ClawSweeper / Rank-up moves: the exact-head review is still in progress with no published findings or Rank-up moves; the queued publisher is not a merge gate under repository policy.

Native SHA-stamped review artifacts validate as READY FOR /prepare-pr, with valid linked issue, passing behavioral sweep, zero findings, and no proof gaps. The analogous New Session signature is explicitly recorded as a separate, out-of-scope follow-up. AI-assisted: yes.

@steipete
steipete merged commit fae9bd6 into main Aug 20, 2026
317 of 319 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/autoqa-164-mixed-role-node branch August 20, 2026 13:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 21, 2026
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 size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Devices page keeps a mixed-role node online after its node session disconnects

1 participant