Skip to content

fix: unify capability count across all UI surfaces - #488

Merged
shanselman merged 1 commit into
openclaw:masterfrom
ranjeshj:fix/capability-count-consistency
May 21, 2026
Merged

shanselman merged 1 commit into
openclaw:masterfrom
ranjeshj:fix/capability-count-consistency

Conversation

@ranjeshj

Copy link
Copy Markdown
Contributor

Problem

The Connection page and Permissions page showed 7 capabilities while the tray menu and instances page showed 10 capabilities. The missing 3 were always-on capabilities (app, device, system) that aren't gated by settings toggles.

Root Cause

Connection page and Permissions page hardcoded 7 settings-gated capabilities (browser, camera, canvas, screen, location, tts, stt) instead of reading from the same \GatewayNodeInfo\ source of truth used by the tray menu and instances page.

Fix

  • Added \NodeCapabilityGating.GetLocalNodeCapabilities()\ shared helper that reads from \AppState.Nodes\ (same \GatewayNodeInfo\ source as tray/instances)
  • \ConnectionPage: \BuildCapabilityListString, \BuildCapabilityChips, status text, and fingerprint now use gateway data
  • \PermissionsPage: \UpdateNodeStatus\ uses the shared helper
  • Returns .ToArray()\ snapshot for thread-safety (\List\ is mutable)
  • Guards against empty capability strings in chip rendering

Validation

  • Build: ✅
  • Shared tests: 1803 passed, 28 skipped
  • Tray tests: 1149 passed

Files Changed

  • \src/OpenClaw.Tray.WinUI/Services/NodeCapabilityGating.cs\ — shared helper
  • \src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs\ — read from gateway
  • \src/OpenClaw.Tray.WinUI/Pages/PermissionsPage.xaml.cs\ — read from gateway

Connection page and Permissions page hardcoded 7 settings-gated capabilities
(browser, camera, canvas, screen, location, tts, stt) while the tray menu
and instances page read from GatewayNodeInfo which reports all 10 registered
capabilities (including always-on: app, device, system).

Changes:
- Add NodeCapabilityGating.GetLocalNodeCapabilities() shared helper that
  reads from AppState.Nodes (same GatewayNodeInfo source as tray/instances)
- ConnectionPage: BuildCapabilityListString, BuildCapabilityChips, status
  text, and fingerprint now use gateway data instead of hardcoded toggles
- PermissionsPage: UpdateNodeStatus uses the shared helper
- Return .ToArray() snapshot for thread-safety (List<string> is mutable)
- Guard against empty capability strings in chip rendering

Co-authored-by: Copilot <[email protected]>
@shanselman
shanselman merged commit 7d59d8d into openclaw:master May 21, 2026
17 checks passed
shanselman added a commit that referenced this pull request May 21, 2026
Gate system.run and system.run.prepare behind the Permissions page toggle while keeping the rest of the system capability registered. Rebuild node capabilities from current settings on reconnect so permission changes take effect without restarting the tray.

Resolved against #483/#488 after local validation.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants