Skip to content

fix: stop PR status reads for session-only viewers - #160979

Merged
Patrick-Erichsen merged 4 commits into
openclaw/scope-ui-01-publish-20260929from
openclaw/scope-ui-02-pr-status-20260929
Oct 2, 2026
Merged

Patrick-Erichsen merged 4 commits into
openclaw/scope-ui-01-publish-20260929from
openclaw/scope-ui-02-pr-status-20260929

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: Chat, sidebar, and session menus retry PR-status subscriptions when a session-only operator lacks operator.read.

User Impact

User impact: Those views no longer issue denied PR subscriptions or expose retired cached PR details.

Why This Change Was Made

Use the connection’s read-scope decision at each consumer and at the shared snapshot store, including one-shot loads and scope-revocation cleanup.

Evidence

  • PR store/sidebar regressions passed (174/174 focused UI tests; one-worker wall 32.73 s). The same-client render test hides and restores a saved PR badge on read-scope change. Isolated Chromium proved the allowed → revoked reconnect path: the visible badge disappears and no new subscription is sent (test body 2.31 s; Testbox proof).
  • Server authorization is unchanged; no live role grants or Gateway identities were altered.
  • Same-route Control UI browser captures: /chat/main/scope-proof-session, light theme, 1180×800, synthetic session-only scopes; deterministic mock Gateway for rendering and independent isolated real-Gateway authorization proof. Baseline 6f4c801c18f9 → original candidate 8683373ae107; the repaired head is 161df93af45d. This pair shows a hovered sidebar row, not an open menu; the wire-count reduction was also verified on the original candidate, and the later revocation test covers the repaired head.

Before
Before: PR status sidebar

After
After: PR status subscriptions gated

  • Wire proof: controlUi.sessionPullRequests.subscribe 2 → 0 requests; the real Gateway returned FORBIDDEN without operator.read. Further route/request receipts are retained in task proof metadata.
  • Required remote checks passed for 161df93af45d in exact-head CI, including openclaw/ci-gate. The GitHub stack grouping was removed without changing this head; individual guarded landing is in progress.

Contributor credit: Patrick requested the audit-backed repair.

Work sessions

@clawsweeper

clawsweeper Bot commented Sep 29, 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 P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 1:31 AM ET / 05:31 UTC (Revision 6).

ClawSweeper review

What this changes

The Control UI gates pull-request status requests and cached details on the connection’s read access across chat, sidebar indicators, and session menus.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main lacks the read-scope gates, and the earlier saved-sidebar-summary finding is resolved. No introduced blocking defect was found.

Priority: P2
Reviewed head: 161df93af45dc2dbb6e8c943f1555e911ac8aa3c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful scope-lifecycle coverage and inspected visual evidence; no blocking patch defect remains.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The ordinary external-contributor proof gate is exempt for this bot-authored PR. Inspected screenshots support the visible session-only flow; the body reports subscription suppression and repaired-head revocation coverage, while the Chromium regression uses a mock Gateway. Linked Testbox logs could not be inspected because artifact storage was blocked. No persisted data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate is exempt for this bot-authored PR. Inspected screenshots support the visible session-only flow; the body reports subscription suppression and repaired-head revocation coverage, while the Chromium regression uses a mock Gateway. Linked Testbox logs could not be inspected because artifact storage was blocked. No persisted data contract changes.
Evidence reviewed 8 items Pinned introduced change: Reviewed the complete merge-base-to-head diff using the supplied introduction identities. The stale test merge was not used to infer removal of current-main behavior.
Shared store admission and retirement: Subscription synchronization now uses the existing connection-and-scope helper, aborts unavailable requests, clears snapshots, and settles pending loads. One-shot loads and cache reads independently use the same gate.
Earlier finding resolved: The sidebar summary accessor checks current read access before returning either a projected snapshot or the saved row fallback. The added Lit lifecycle regression exercises same-client revocation and restoration, addressing the concrete prior finding.
Findings None None.
Security None None.

How this fits together

The Control UI receives connection permissions and session data from the Gateway. Its shared pull-request snapshot store feeds chat details, sidebar badges, and session menus.

flowchart TD
  A[Gateway connection permissions] --> B[Read access and method gate]
  C[Visible sessions and menu requests] --> B
  B -->|Allowed| D[Shared PR snapshot store]
  B -->|Unavailable| E[Retire requests and cached details]
  D --> F[Chat details and sidebar badges]
  D --> G[Session menus]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +30, Tests +261. Total +291 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 65 35 +30
Tests 6 265 4 +261
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 330 39 +291

Review metrics

Metric Value Why it matters
Production versus regression coverage production +30 net lines; tests and test support +261 net lines Production growth implements shared admission and cache retirement, while coverage exercises denied access, revocation, restoration, and browser rendering.

Technical review

Best possible solution:

Keep PR-status presentation and requests aligned with the Gateway’s existing read permission through the shared snapshot owner.

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

Yes, source establishes the path: a connected session-only viewer sees the advertised PR subscription method, and current main attempts it without checking operator.read. This review did not execute the application.

Is this the best way to solve the issue?

Yes, the patch reuses the existing scope helper at the shared store and its consumers, including the saved sidebar fallback, without creating another permission policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This focused repair prevents denied background reads and stale PR presentation for session-only viewers without changing server permissions.
  • 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. Not applicable: The ordinary external-contributor proof gate is exempt for this bot-authored PR. Inspected screenshots support the visible session-only flow; the body reports subscription suppression and repaired-head revocation coverage, while the Chromium regression uses a mock Gateway. Linked Testbox logs could not be inspected because artifact storage was blocked. No persisted data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary external-contributor proof gate is exempt for this bot-authored PR. Inspected screenshots support the visible session-only flow; the body reports subscription suppression and repaired-head revocation coverage, while the Chromium regression uses a mock Gateway. Linked Testbox logs could not be inspected because artifact storage was blocked. No persisted data contract changes.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the complete merge-base-to-head diff using the supplied introduction identities. The stale test merge was not used to infer removal of current-main behavior. (161df93af45d)
  • Shared store admission and retirement: Subscription synchronization now uses the existing connection-and-scope helper, aborts unavailable requests, clears snapshots, and settles pending loads. One-shot loads and cache reads independently use the same gate. (ui/src/lib/session-pull-requests.ts:358, 161df93af45d)
  • Earlier finding resolved: The sidebar summary accessor checks current read access before returning either a projected snapshot or the saved row fallback. The added Lit lifecycle regression exercises same-client revocation and restoration, addressing the concrete prior finding. (ui/src/components/app-sidebar-session-pr-indicators.ts:69, 161df93af45d)
  • Existing authorization contract: The Gateway method descriptor assigns operator.read to PR subscriptions. The existing UI helper combines connection state, method advertisement, and shared scope implications; the PR changes neither server authorization nor role grants. (src/gateway/methods/core-descriptors.ts:434, 161df93af45d)
  • Still necessary on current main: The fetched main store still admits subscriptions based on connection state and method advertisement without the added read-scope gate, and exposes snapshots directly. The candidate head is not contained in the supplied latest release; no already-merged equivalent was established. (ui/src/lib/session-pull-requests.ts, 504d2905d69c)
  • Inspected visual evidence and reported runtime observations: Both downloaded before/after images were inspected. They show the synthetic session-only chat route, rather than an open PR menu or revocation trace. The captured PR body separately reports PR subscription requests decreasing from two to zero, real-Gateway FORBIDDEN enforcement, and a repaired-head Chromium revocation scenario. The linked Testbox run is a canceled shell session; log inspection was blocked by the artifact storage host allowlist, so its execution output was not independently verified.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-29T05:13:17.559Z sha 8683373ae1072d96b27930171d2274d708a9f194 :: needs real behavior proof before merge. :: [P1] Retire the sidebar PR summary when read access is revoked
  • reviewed 2026-09-29T05:45:56.054Z sha 8683373ae1072d96b27930171d2274d708a9f194 :: needs real behavior proof before merge. :: [P1] Retire the sidebar PR summary when read access is revoked
  • reviewed 2026-09-29T05:54:06.754Z sha 8683373ae1072d96b27930171d2274d708a9f194 :: needs real behavior proof before merge. :: [P1] Retire the sidebar PR summary when read access is revoked
  • reviewed 2026-09-29T07:16:17.118Z sha 161df93 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T05:21:11.921Z sha 161df93 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 29, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 29, 2026 05:48
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 29, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/scope-ui-02-pr-status-20260929 branch from 8683373 to 161df93 Compare September 29, 2026 07:06
@clawsweeper clawsweeper Bot added 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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. labels Sep 29, 2026
@roboclaw-bot
roboclaw-bot removed this pull request from stack #160986 October 1, 2026 05:14
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Oct 1, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/scope-ui-01-publish-20260929 branch from 80d4681 to 8d7ff60 Compare October 1, 2026 05:57
@Patrick-Erichsen
Patrick-Erichsen merged this pull request into openclaw/scope-ui-01-publish-20260929 Oct 2, 2026
121 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the openclaw/scope-ui-02-pr-status-20260929 branch October 2, 2026 19:34
Patrick-Erichsen added a commit that referenced this pull request Oct 2, 2026
* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): retire saved PR indicators when read access ends

Co-authored-by: Patrick-Erichsen <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Patrick-Erichsen added a commit that referenced this pull request Oct 2, 2026
…on (#160978)

* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers (#160979)

* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): retire saved PR indicators when read access ends

Co-authored-by: Patrick-Erichsen <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: skip discussion probes without read access (#160980)

* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): retire saved PR indicators when read access ends

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: skip discussion probes without read access

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: gate saved Discussion tab reads after reconnect

Co-authored-by: Patrick-Erichsen <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): compose read gates with shared publication

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…on (openclaw#160978)

* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers (openclaw#160979)

* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): retire saved PR indicators when read access ends

Co-authored-by: Patrick-Erichsen <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: skip discussion probes without read access (openclaw#160980)

* fix: prevent publication scope errors in session-only chat

Co-authored-by: Patrick-Erichsen <[email protected]>

* test(ui): advertise GitHub options in publication flows

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: stop PR status reads for session-only viewers

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): retire saved PR indicators when read access ends

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: skip discussion probes without read access

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix: gate saved Discussion tab reads after reconnect

Co-authored-by: Patrick-Erichsen <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(ui): compose read gates with shared publication

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Patrick Erichsen <[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: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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.

2 participants