Repository navigation
fix(ui): respect read scopes for publication, PR status, and discussion - #160978
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. Reviewed October 2, 2026, 4:05 PM ET / 20:05 UTC (Revision 11). ClawSweeper reviewWhat this changesThe Control UI checks current read permissions before loading publication, PR-status, and Discussion data, and retires cached details and callbacks when access changes. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still admits these reads from method advertisement alone. The prior fixture finding and both rank-up moves are addressed, and no blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI consumes the Gateway connection’s method catalog and granted scopes to load session information. Shared stores and chat controllers turn those responses into publication controls, PR indicators, and Discussion panels. flowchart TD
A[Gateway connection and scopes] --> B[Shared method permission helper]
B --> C{Read permitted?}
C -->|Yes| D[Session stores and chat controllers]
C -->|No| E[Retire cached data and callbacks]
D --> F[Publication controls and PR indicators]
D --> G[Discussion panel]
E --> F
E --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +43, Tests +418. Total +461 across 17 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep permission projection with the shared helper and lifecycle owners, preserving guest publication while unavailable PR and Discussion data is retired. Do we have a high-confidence way to reproduce the issue? Yes: current-main advertisement-only admission can issue broad PR and Discussion reads from a session-only connection. Source establishes the path; this review did not execute it. Is this the best way to solve the issue? Yes: reusing the existing permission helper and retiring data through established store and connection lifecycles is a narrow repair that preserves shared guest publication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8af8744f74df. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
80d4681 to
8d7ff60
Compare
|
Coordination with #162916 and #160979: the existing shared-publication contract permits ordinary changes from a requester's own session under This PR's capability-based attachment gate can compose with that repair:
This is a composition note for the eventual shared result, not a claim that #162916 is already fixed or a request to duplicate the backend work. |
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
* 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: 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]>
596081a to
fabe720
Compare
|
The cumulative candidate preserves shared guest publication while gating broad PR-status and Discussion reads. It includes #160979 and #160980, rebased onto Fresh validation: 166/166 focused UI tests, 66/66 final PR-store/sidebar owner tests after predicate dedup, and 22/22 Chromium tests across publication, guest receipt recovery, Discussion, archived actions, and scope revocation. The final 2/2 scope run verifies the delivered handshake, zero sidebar badge and chat PR-link elements after capture, connected session-only scopes, and no extra general PR subscription. Full-candidate structured autoreview is scoped-clean at P0. Bounded In the comparable revocation pair, the sidebar badge and composer PR chip disappear while the transcript remains available. Guest publication independently retains Disposition of the October 2, 19:41 UTC ClawSweeper review:
The review is less than twelve hours old. These updates address its findings plus mechanical composition and predicate deduplication, so no additional review trigger is needed; exact-head CI remains the landing gate. |
|
Merged via squash.
|
…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]>




What Problem This Solves
The Control UI used advertised methods to start publication, PR-status, and discussion reads even when the connection lacked the method's read scope. Reconnects could also leave retained PR details and Discussion callbacks attached to obsolete permissions.
This cumulative PR includes the PR-status/sidebar repair from #160979 and the Discussion repair from #160980, both already merged into this branch.
User Impact
sessions.github.optionsalways requires broadoperator.readis no longer valid.Why This Change Was Made
The Gateway owns authorization. The UI now reuses
canCallGatewayMethodat the snapshot store and its consumers instead of interpreting advertisement as permission. Three store admission/cache checks share one predicate that reads the current Gateway snapshot on every call. Existing connection retirement, request cancellation, waiter settlement, and saved-tab placement remain the lifecycle owners.Production delta: +89/-46, net +43 lines across seven production files. Store cleanup absorbs the duplicated gates and is net -1 line. Remaining growth carries concrete revocation cleanup and retained Discussion generation/client checks; there are no new configuration, storage, or server-authorization contracts.
Regression tests and test support: +424/-6, net +418 lines; no generated or lockfile changes.
Evidence
4e529baa8f6dc431fd93f8591859a022d29858fb, preserving all four original authored commits. Fixed one test-fixture merge conflict and two expectations that predated shared guest publication.controlUi.sessionPullRequests.subscriberequest. Guest proof showsPublish PR→Open PRwith no general PR subscription, personal publication, or confirmation request.check-changedagainst the pinned base passed: repository guards, eight affected test type graphs, UI typecheck, i18n verification, all three Knip scans, formatting, and lint.git diff --checkalso passed.Review Notes
Fresh full-candidate structured autoreview against
4e529baa8f6dc431fd93f8591859a022d29858fbcompletedscoped-cleanwith no accepted/actionable P0 findings. This is the requested priority scope, not a claim that every lower-priority issue was exhaustively reviewed.The latest ClawSweeper review, October 2 at 19:41 UTC on
596081aa, identified the stale publication fixtures and the unresolved main composition. Each before-merge item and both Rank-up moves are addressed:4e529baa, resolved the fixture conflict, and preserved main's shared/personal permission split and guest discovery coverage.The current review is less than twelve hours old and the follow-up changes address its findings, mechanically compose main, and deduplicate an unchanged permission predicate. No extra re-review is requested. Exact published-head CI remains a separate landing gate.
Original Proof and Contributor Context
The images below are retained from the original implementations. They do not depict the final rebased tree. In particular, the original publication options 1 → 0 wire reduction predates the session-scoped shared-publication contract and must not be treated as current expected guest behavior.
Original publication repair
Original baseline
6f4c801c18f9→ candidate439d51b4c210. Original focused browser proof: Testbox run, 15/15. The original real Gateway deniedsessions.github.optionswithoutoperator.readunder that earlier contract. Old head8d7ff60ad086had unrelated main CI failures in run 36822274679; neither that failure nor prior successful CI is counted as current-head proof.Original PR-status/sidebar repair
Original wire proof: general PR subscriptions 2 → 0; isolated real Gateway returned
FORBIDDENwithoutoperator.read. The original screenshot pair shows a hovered row, not an open menu. Repaired-head revocation proof: Testbox run; original exact-head CI for161df93af45d: run 36534673962.Original Discussion repair
Original wire proof:
session.discussion.info1 → 0; isolated real Gateway returnedFORBIDDENwithoutoperator.read. The visible publication difference belongs to an earlier layer; these images do not show saved-tab reconnect behavior. Original exact-head CI for3703df1a8360: run 36534688385.Contributor credit: Patrick requested the audit-backed repair. Original implementation authorship remains RoboClaw/roboclaw-bot in the preserved commits.
Work sessions