Repository navigation
refactor: share operator permissions across Gateway calls and events - #153979
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 September 20, 2026, 5:18 PM ET / 21:18 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR shares operator permission checks across Gateway calls and event delivery, extends background-continuation coverage, documents the behavior, and isolates Stylelint test fixtures. Merge readiness✅ Ready for maintainer review No blocking findings remain. The previous test-cost request is addressed, and this maintainer-requested consolidation remains distinct from the already-merged continuation fix. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway checks operator permissions before dispatching requests or delivering events. The shared policy evaluates granted scopes while existing identity, session-access, and execution-lifetime checks remain with their owners. flowchart TD
A[Authenticated Gateway calls] --> D[Shared operator permission policy]
B[Background tool calls] --> D
C[Outgoing Gateway events] --> D
D --> E[Identity and session checks]
E --> F[Authorized handler or recipient]
D --> G[Reject insufficient permission]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -24, Tests +86, Docs +8. Total +70 across 10 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one shared scope-implication owner while preserving transport matching, role normalization, and existing session and lifetime enforcement. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing behavior; source comparison supports equivalent permission decisions, and no new failure was identified. Is this the best way to solve the issue? Yes. Reusing the existing predicate removes competing permission logic without adding a new API contract, configuration option, or migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6b1495903b21. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
8e6a344 to
af6f73b
Compare
|
@clawsweeper re-review Added the requested single-worker measurements and available final-head CI job durations to the PR's Test cost section. Both repaired CI lanes are green. The code remains unchanged at af6f73b7ea3469b200048f5249aaca91c96ea59d. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Use the existing shared operator-scope policy for RPC and broadcast authorization, keeping raw transport grants exact and avoiding per-recipient allocations. Extend completion-dispatch coverage through the GitHub identity status tool and preserve denial of stronger privileges. Follow-up to #141865.
Keep completion and GitHub identity regressions together in a sibling suite and share the existing Gateway fixtures, preserving coverage within the file-size gate.
The lane-routing test assumed a UI test path was absent; adding that file on main correctly changed the Stylelint plan. Preserve lane assertions and exercise present/deleted files in an owned fixture through the real dry-run CLI.
af6f73b to
a405f03
Compare
|
Merged via squash.
|
…penclaw#153979) * refactor: share operator permissions across Gateway calls and events Use the existing shared operator-scope policy for RPC and broadcast authorization, keeping raw transport grants exact and avoiding per-recipient allocations. Extend completion-dispatch coverage through the GitHub identity status tool and preserve denial of stronger privileges. Follow-up to openclaw#141865. * test: separate continuation authorization coverage Keep completion and GitHub identity regressions together in a sibling suite and share the existing Gateway fixtures, preserving coverage within the file-size gate. * test: isolate changed Stylelint targets from checkout contents The lane-routing test assumed a UI test path was absent; adding that file on main correctly changed the Stylelint plan. Preserve lane assertions and exercise present/deleted files in an owned fixture through the real dry-run CLI.
Related: #141865
What Problem This Solves
Background continuations previously failed read-only checks such as GitHub identity verification despite holding write permission. #141865 fixed that dispatch path, but RPC authorization and event delivery still maintained separate copies of the same permission rules.
User Impact
Gateway calls, background tool calls, and event delivery now share one operator-scope policy. Existing permissions, session checks, and execution-lifetime checks are preserved; no configuration or migration is needed.
Why This Change Was Made
Expose the existing shared scope predicate and use it in RPC authorization and broadcast filtering. Transport grants retain exact matching while the role adapter retains its established normalization. The predicate reads existing arrays, avoiding per-recipient allocations. Write still implies read and Talk, and does not grant admin, approvals, pairing, Talk secrets, or arbitrary future scopes.
Extend the existing completion-dispatch regression to invoke the real GitHub identity status tool after requester settlement. This is the maintainer-requested follow-up to consolidate ownership of the incident fix.
Evidence
git diff --checkpass.a405f038with no remaining findings; its test-cost reporting request is resolved.openclaw/ci-gatechecks are successful.Test cost
Measured on macOS with Node 26.8.2 and
OPENCLAW_VITEST_MAX_WORKERS=1. Wrapper wall time includes startup and any compiler preparation; these are observed runs, not a warm-cache speed comparison.Available job wall times from successful run 35535929857 on
af6f73b7before the final main reconciliation (including setup and other tests in each shard): test types core 2 passed in 4m24s; task-identifier shard passed in 4m40s; tooling shard passed in 7m48s.