Skip to content

fix: hide unavailable browser notification setup for guests - #178164

Merged
shakkernerd merged 3 commits into
mainfrom
guest-push-access
Oct 21, 2026
Merged

shakkernerd merged 3 commits into
mainfrom
guest-push-access

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #178085.

What Problem This Solves

An authenticated guest with session-only scopes sees Ready and Enable notifications in browser notification Settings, even though the Gateway denies the required Web Push calls. The automatic first-send prompt has the same gap: browser support alone makes it eligible to ask for consent before registration predictably fails.

User Impact

Settings now shows that browser notification management is unavailable for the current Gateway access, while retaining the real browser-support and permission values. Enable and test actions are unavailable, and the automatic prompt does not consume its one-shot opportunity for a connection that cannot register push.

Existing browser subscriptions can still be unsubscribed locally when remote removal is denied. Read-only connections can inspect their existing preferences through disabled native controls, keeping labels and values available to assistive technology. Authorized personal and admin connections keep their existing setup flow. This does not grant guest scopes, change notification consent or device/profile binding, or add push delivery support.

Why This Change Was Made

The capability now derives current read and write access through the existing Gateway method-access helper. The fixed core push methods include intentionally unadvertised methods, so method-catalog presence is not treated as a permission requirement. Settings and the synchronous first-send prompt consume the same capability state.

The runtime checks current access before requesting browser consent and before later Gateway or subscription effects. Access changes and disconnects invalidate displayed subscription/preferences state; an existing browser subscription without registration authority is identified as local rather than presented as registered with this Gateway.

Evidence

The added owner regression fails on the unchanged production baseline because a session-only guest requests browser permission; the other 17 existing cases pass. The candidate covers denied setup, read-only preferences with local opt-out, same-client access changes, disconnects and revocation while consent is pending. Existing authorized registration, device-mismatch and preference-save cases remain in the same harness.

The qualified integration browser run uses unchanged real guest/admin admission. Guest Settings removes the unusable enable action; Admin Settings retains it. A guest's first accepted new-session send and background-palette send each make zero permission requests and leave the automatic-prompt marker absent. In the transport control, a real Admin WebSocket closes while synthetic consent is pending. The native close handler publishes disconnected access before consent is released: zero raw push attempts, zero wire push RPCs and zero browser subscriptions follow.

Read-only, loading, disconnected and local opt-out component scenarios use explicitly synthetic state in the actual served renderer. All 21 read-only native fields are disabled while labels and values remain in the accessibility tree. Clicking Unsubscribe invokes its synthetic callback once and no other mutation callback. This does not claim a real subscription was removed. Three existing isolated role-owner cases also pass, tracing canonical role mutation through policy invalidation and client disconnect; actual live role writes and full notification delivery are outside this proof. A later real authorized registration control is recorded below.

Remote formatting, lint and English-catalog verification pass. All 20 type graphs selected by native consumer discovery are qualified; unchanged results were reused and affected inputs rerun after corrections. Eight selected test files cover 107 passing cases. The final accessibility correction passed 43 affected owner, Settings and browser cases in 5.76 seconds including the wrapper. The additional three role-owner cases took 43.36 seconds, primarily cold transforms. Original-source CI passes on e04d232a7fe9; successful selected jobs total 4,279 elapsed job-seconds. Skipped lanes remain skipped.

The original guest and transport-loss media below comes from native integration producer d1f7a5961450, containing the qualified notification inputs from PR source e04d232a7fe9 on the preserved lab base. It is not a deployment of the entire PR checkout. The notification renderer, access helper, auto-prompt module and English notification section match; runtime differences are comments only. Older shared controls, Gateway presentation and listener registration remain in that integration and were checked for the relevant disabled-control and connected-access behavior. Exact PR-source component tests remain separate evidence.

Visual evidence

Open preview

Before After
Guest Settings incorrectly advertises Ready and Enable notifications Guest Settings explains unavailable Gateway access while keeping browser support and permission unchanged

Actual connection closes before held synthetic consent is released; address redacted, playback at half speed

connection-close-proof.mp4

Visual verification

  • Baseline: 46110002bf93db2af023262752dc5262a58dfd0d with unrelated lookup-message UI changes
  • Exact head: d1f7a596145000e56b1d9834526368d39d0310de
  • Scenario: Actual guest Settings before and after the access fix; actual Admin transport loss while a synthetic consent result is held. Supplementary read-only controls use explicitly synthetic values.
  • Runtime/build: Native integration build d1f7a5961450, tree cd6b9e327f5b39a064b5846da227b1187048faf5; notification inputs qualified from PR source e04d232. Renderer, access helper and auto-prompt module are byte-identical; runtime differs only in two comments and the shell retains its earlier listener registry.
  • Guest first sends: 0 permission calls; browser permission default; automatic-prompt marker absent
  • Connection-loss control: 1 real socket close; access false before release; 0 raw push attempts, 0 wire push calls, 0 browser subscriptions
  • Read-only fixture: 21 native fields disabled with readable accessibility values; one synthetic unsubscribe callback and no save/test/subscribe callback
  • Actual browser consent, Gateway scopes, profile bindings, keys and subscriptions remained unchanged.
  • The baseline JPEG was decoded to PNG without editing its content; the original and its digest are retained.
  • Matching guest route, theme, viewport and authority; navigation hover/focus and the genuine build footer differ.
  • The recording uses real UI/client/transport/store state with synthetic held consent and push-side-effect observers; full authorized push delivery and live role writes are not claimed.
  • Original recordings and actual source/build provenance are retained; only the curated clip is published.

Authorized and read-only controls

The first image is the actual Admin Settings control. “Guest Lab” is the Gateway display name; the connection has operator.admin. The second is a scrolled synthetic read-only fixture showing disabled values, including quiet hours and browser preferences.

Actual Admin Synthetic read-only values
Actual Admin retains enabled notification setup Synthetic read-only preferences remain visible in disabled controls

Synthetic local opt-out interaction, at half speed; one unsubscribe callback and no other mutation callbacks:

local-opt-out-proof.mp4

Actual authorized registration control

A disposable persistent Chrome profile connected through the existing configured Admin identity and trusted-proxy authentication. The normal Settings Enable notifications action reached the real browser push service and Gateway registration; browser methods and Gateway responses were not mocked. Notification permission was granted only to that disposable profile through browser automation. This run used native integration producer 617f152e8112, tree 61d29b1f65c1f03bc510a1248e20e699feef75cf; the notification inputs from e04d232a7fe9 retain the qualified source correspondence described above.

Sanitized observations from the pass-through browser and Gateway receipts:

Initial state: permission=default; browser subscription absent
Settings Enable actions: 1
push.web.vapidPublicKey: success
PushManager.subscribe: 1 call, 1 resolved, 0 rejected
push.web.subscribe: success
push.web.preferences.get: success; durableIdentity=true
Browser afterward: permission=granted; subscription present

Cleanup through the same native identity and device:
Reconnect reconciliation: same subscription ID; no new browser subscribe
push.web.unsubscribe: success; removed=true
PushSubscription.unsubscribe: 1 call; returned true
PushManager.getSubscription: null
Durable subscription: absent
Created device: removed; pre-existing devices, scopes and profiles preserved
Original fixture routing: restored

The initial test keypair was created through the existing native owner and retained. Existing keys, profiles, roles, preferences and browser permissions were preserved. No test notification was sent; this establishes registration and cleanup, not delivered push notifications.

Earlier integration result (617f152e8112): Settings remained on Checking…, displayed the stale Not requested value and never exposed its Unsubscribe button. Checking was already visible before Enable; the recording preserves the failure to refresh after registration. Cleanup used the native subscription owners because the UI control was unavailable; no successful Settings-unsubscribe claim is made.

This is a separate pre-existing Web Push presentation defect: Settings forwards the mutable owner snapshot into a reference-memoized Show value. Both boundaries exist on the pre-change baseline, and this PR does not change the snapshot contract. That same boundary can retain old access controls after a same-user reconnect with reduced scopes. Runtime guards still deny unauthorized effects, but the shared correction landed in #178640 and is included in this branch. Native notifications already replace their snapshots and are not included in that diagnosis.

A focused consumer check passes on this PR’s unchanged e04d232a7fe9 source combined with the exact production change from 7419dcdeba38 in #178640. It keeps the real mutable Web Push capability and Settings page mounted while the same user reconnects with Admin, read-only and guest access. Unavailable Enable/test actions disappear, readable preferences remain disabled, guest preferences disappear, and local Unsubscribe still works without a permission request or an unauthorized push call. The case asserts that the owner snapshot retains its identity; the fixture does not clone it. Gateway admission and browser interfaces are synthetic. The single case passed through the native UI runner in 4.67 seconds (6.30 seconds including the test wrapper). The shared correction landed in #178640 and is now incorporated into this candidate. Its authorized test fixture declares the two access fields required by this PR. The integrated candidate passed current fast checks, all 20 selected compiler graphs, and all 27 Settings cases (5.43 seconds in Vitest; 7.07 seconds including the wrapper). Independent review is clean on integrated head c0851fe203fe; ClawSweeper rates that head Diamond (5/6), with no findings. Current-head CI has 28 successful jobs and 26 skipped jobs. Its only substantive failure is the inherited Doctor unbound-method lint error; the aggregate gate reports the same failure. The error reproduces on the unchanged CI base. The independently landed repair is effective in the combined result and has qualified passing lint and receiver-behavior evidence. The failed CI result is retained; other selected jobs pass. Non-skipped jobs total 4,675 elapsed job-seconds. The accepted synthetic case remains separate from the subsequent live Settings completion below.

The continuous recording below is cropped to the actual notification controls, with the unrelated sidebar removed. It shows the single Enable interaction and the stale resulting UI; it does not substitute a fabricated successful after-state.

settings-registration-stuck.mp4

Settings completion with the shared correction

The actual authorized Settings scenario now succeeds with the correction from #178640 in retained integration producer d76083dff482, tree 5a50037043c9fc8b138356d1c605d73e3082a05e. The relevant notification path differs from the previously qualified 617f152e8112 producer only by that exact snapshot-copy production hunk. This is qualified integration evidence, distinct from this PR’s public head.

The UI changes from Ready / Not requested / Not subscribed to Subscribed / Granted, exposes Unsubscribe, and returns to Ready / Granted / Not subscribed after that action. There is no stuck Checking or error state. Exactly one browser subscription and one Gateway registration succeed; one UI Unsubscribe then produces Gateway removed:true, native browser unsubscribe success and a null browser subscription. The durable subscription count returns to zero and the disposable device is removed through the native owner. All current device IDs, roles and scopes and all four profiles are preserved during this scenario, along with the existing VAPID pair and configuration; the original fixture routing is restored.

Permission was granted through browser automation only for the disposable origin. The observed browser and Gateway operations were not mocked; this is not a recording of a human granting consent. No test notification or delivered push notification is claimed. The new recording is one contiguous 33-second interval with both UI actions and their settled results, without retiming, splicing or reconstructed product pixels. It is a separate capture from the earlier failure clip.

Corrected integration: Subscribed and Granted with Unsubscribe available

notifications-enable-unsubscribe-continuous.mp4

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L labels Oct 20, 2026
@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes browser notification setup and automatic consent prompts respect current Gateway access while preserving readable preferences and local unsubscribe.

Example: A guest connects with operator.sessions.read and operator.sessions.write, with browser notification permission still default.

  • Before: Settings shows Ready and Enable notifications, and a first send can request consent before Gateway registration is denied.
  • After: Settings explains that notification management is unavailable, hides setup actions, and preserves the automatic prompt opportunity.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful fix with qualified shipped-path evidence, preserved authorized behavior, distinct regressions, and no actionable findings; pending CI is separate from the patch rating.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Qualified built-Control-UI evidence covers guest setup and first sends, real Admin registration and unsubscribe, and transport loss before held consent resolves with zero subsequent push RPCs or browser subscriptions; mounted-owner checks cover synthetic scope transitions and read-only controls. Screenshots and runtime receipts were inspected; videos were unavailable because ffprobe was missing and playback fetches failed. Human consent dialogs and notification delivery are explicitly outside the claims.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Guests are offered notification setup and browser consent for Gateway operations their scopes cannot complete.
Reason: The maintainer-authored direction restores truthful availability without expanding guest permissions, changing stored preferences, or removing authorized setup.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes a current guest notification setup defect; no actionable introduced defect was found, and exact-head CI remains pending.

Priority: P2
Reviewed head: c0851fe203fe2f380b8860cb7c95c2f220d0dd47

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI notification capability combines browser support, consent, subscriptions, and current Gateway access into Settings and first-send behavior; its runtime performs browser subscription operations and Gateway push RPCs.

flowchart TD
  A[Gateway connection and scopes] --> B[Shared method access helper]
  B --> C[Web Push capability]
  C --> D[Notification Settings]
  C --> E[First send prompt]
  D --> F[Guarded notification runtime]
  E --> F
  F --> G[Browser Push API]
  F --> H[Gateway push RPCs]
Loading

Technical review

Best possible solution:

Retain the shared access projection and guarded runtime with the incorporated Settings publication correction.

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

The current-main browser-only readiness and consent path conflict with the verified Gateway scope requirements, matching the linked report and inspected baseline screenshot; no target code was executed during this review.

Is this the best way to solve the issue?

The patch fixes the existing capability owner and its consumers using shared scope semantics; its small access module serves both synchronous presentation and lazy runtime admission, while the added tests cover distinct failures without unnecessary production machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced patch and current-main boundary: The pinned introduced diff changes notification access, runtime guards, rendering, English copy, documentation, and related tests. The fetched main has no corresponding access fix in the production notification owners. (ui/src/app/web-push-access.ts:9, c0851fe203fe)
  • Authoritative scope contract: Subscription, VAPID, test, unsubscribe, and preference writes require operator.write; preference reads require operator.read. Several push methods are deliberately unadvertised, so the new helper correctly avoids catalog-presence gating. (src/gateway/methods/core-descriptors.ts:417, c0851fe203fe)
  • Current authority at effects: The runtime checks the active client, connected phase, and current access before forwarding RPCs, before consent, and before creating a browser subscription; local unsubscribe retains its existing best-effort remote removal contract. (ui/src/app/web-push.runtime.ts:58, c0851fe203fe)
  • Shared Settings correction is incorporated: fix: refresh notification settings after Web Push updates #178640 merged the shallow presentation copy needed for mutable capability publications to reach mounted Settings controls; that exact production line is present in this checkout and belongs to the merged change. (ui/src/pages/config/config-page-state.ts:938, f6ed66162970)
  • Inspected browser evidence and runtime receipts: The full PR body supplies qualified integration provenance, guest first-send observations, real-disconnect negative controls, and actual authorized browser/Gateway registration and cleanup receipts. Inspected guest before/after, Admin, read-only, and corrected registration screenshots agree with the stated outcomes. (c0851fe203fe)
  • Exact-head checks remain pending: Live reads confirm the reviewed head is unchanged and mergeable. Lint, test-type, and UI E2E checks are queued, dispatch is cancelled, and openclaw/ci-gate is pending; these are incomplete validation, not demonstrated patch failures. (c0851fe203fe)

Likely related people:

  • Peter Steinberger: Raw commit 87ecc40 adds ui/src/app/notifications-auto-prompt.ts:58 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 87ecc4085d43; files: ui/src/app/notifications-auto-prompt.ts)
  • Shakker: Raw commit f6ed661 adds ui/src/pages/config/config-page-state.ts:938 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f6ed66162970; files: ui/src/pages/config/config-page-state.ts)
  • Galin Iliev: Raw commit 14e26a3 adds ui/src/app/web-push.runtime.ts:179 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 14e26a380d34; files: ui/src/app/web-push.runtime.ts)

PR surface

Source +174, Tests +255, Docs +2. Total +431 across 14 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 225 51 +174
Tests 7 275 20 +255
Docs 1 4 2 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 504 73 +431

Root-cause cluster

Relationship: same_root_cause
Canonical: #178085
Summary: This PR repairs the reported guest access mismatch; the merged Settings publication repair addresses a separate presentation boundary needed by the same flow.

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 defect misleads guests during optional notification setup without blocking chat or the first useful run.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-20T07:07:49.063Z sha e04d232 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T08:27:01.912Z sha e04d232 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T23:04:13.151Z sha c0851fe :: needs maintainer review before merge. :: none

Reviewed October 20, 2026, 7:10 PM ET / 23:10 UTC (Revision 4).

@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR now includes verified guest/Admin Settings captures, actual guest first-send observations, and a recording of a real Admin transport disconnect before held synthetic consent is released: no push RPC or browser subscription follows. It also includes accessible read-only controls and the synthetic local opt-out interaction. The evidence distinguishes the integration build from the PR source and does not claim live role mutation or full push delivery.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The branch now includes the shared Settings projection fix from #178640. The PR body contains actual authorized Enable → browser/Gateway registration → UI Unsubscribe evidence with native cleanup, plus a passing real-owner/mounted-Settings scope-change check using synthetic admission and browser inputs. The earlier registration-evidence gap and stale access controls are addressed on c0851fe203fe2f380b8860cb7c95c2f220d0dd47; the consent-dialog and notification-delivery limits remain explicit.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 20, 2026
@shakkernerd
shakkernerd merged commit 45f9aed into main Oct 21, 2026
108 of 112 checks passed
@shakkernerd
shakkernerd deleted the guest-push-access branch October 21, 2026 00:14
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: browser notification setup and automatic prompts now respect Gateway access while preserving read-only preferences and local opt-out.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…#178164)

Browser notification setup and automatic prompts now respect current Gateway access, while preserving readable preferences and local opt-out.

Fixes openclaw#178085.
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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.

[Bug]: Guest notification settings offer setup without required Gateway access

1 participant