Repository navigation
fix: hide unavailable browser notification setup for guests - #178164
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +174, Tests +255, Docs +2. Total +431 across 14 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)Reviewed October 20, 2026, 7:10 PM ET / 23:10 UTC (Revision 4). |
|
@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. |
|
🦞👀 Re-review progress:
|
e04d232 to
c0851fe
Compare
|
@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 |
|
🦞👀 Re-review progress:
|
|
Fixed: browser notification setup and automatic prompts now respect Gateway access while preserving read-only preferences and local opt-out. |
…#178164) Browser notification setup and automatic prompts now respect current Gateway access, while preserving readable preferences and local opt-out. Fixes openclaw#178085.
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 sourcee04d232a7fe9on 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
Actual connection closes before held synthetic consent is released; address redacted, playback at half speed
connection-close-proof.mp4
Visual verification
d1f7a596145000e56b1d9834526368d39d0310deAuthorized 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.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, tree61d29b1f65c1f03bc510a1248e20e699feef75cf; the notification inputs frome04d232a7fe9retain the qualified source correspondence described above.Sanitized observations from the pass-through browser and Gateway receipts:
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
e04d232a7fe9source combined with the exact production change from7419dcdeba38in #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 headc0851fe203fe; 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 Doctorunbound-methodlint 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, tree5a50037043c9fc8b138356d1c605d73e3082a05e. The relevant notification path differs from the previously qualified617f152e8112producer 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.
notifications-enable-unsubscribe-continuous.mp4