Repository navigation
fix: let admins suspend OpenClaw ID members and use one role for everyone - #201610
Conversation
…yone OpenClaw-Publication: d93055c8-6d98-8381-b69a-b65555e27201
|
🦞👀 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 Gateway profile roles authoritative for OpenClaw ID members and imports matching saved work into that representation. Example: An administrator clears acct-member's profile role on a Gateway with role definitions and no default.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: the unified role authority has clear value, and the reviewed authorization and migration paths reveal no blocking code defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway authentication maps verified people to profiles; profile roles then constrain connections, session access, agent execution, and recovered work. flowchart TD
A[Verified sign in] --> B[Canonical profile]
C[Current membership] --> B
B --> D[Profile role policy]
D --> E[Request admission]
E --> F[Sessions and agent work]
D --> G[Discovery role label]
Technical reviewBest possible solution: Use the canonical profile role across member transports and saved-work admission, preserving owner authority and captured restrictions. Do we have a high-confidence way to reproduce the issue? Current-main source confirms separate membership and profile policies and the refusal to assign member roles through users.setRole; no target code was executed during this read-only review. Is this the best way to solve the issue? The shared profile owner is the appropriate boundary, and the migration preserves matching captured grants; the linked issue's collaborator restrictions remain outside this PR. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c1dbc0ea30ff. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel 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 (13 earlier review cycles; latest 8 shown)
Reviewed November 20, 2026, 12:53 AM ET / 05:53 UTC (Revision 14). |
OpenClaw-Publication: 913ea773-48a2-8bcd-94b6-574963ebeaa5
OpenClaw-Publication: b823b9f7-df8e-8e24-ae49-80927ff76f5e
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
OpenClaw-Publication: 772ee69e-762b-872e-a25c-67d2fe26b3dc
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Exact-head behavior/upgrade proof for
Important gap: latest stable does not ship OpenClaw ID: its CLI rejects Package SHA-256:
Lease |
OpenClaw-Publication: 6a433e14-dce3-89c0-bda8-16a4fde286c8
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Assert that a previously admitted history read returns only the stopped notice’s own failed job. Keep source removal and late delivery separate from fresh-request denial at admission. Co-authored-by: jalehman <[email protected]>
Closes #201526 (parts A–C; part D is in a separate PR)
What Problem This Solves
People who reach a claw through OpenClaw ID were governed by a second role system. Their membership role decided what they could do, separately from the Gateway profile role that every other sign-in route uses. Because of this, admins couldn't suspend a member, @mention invitations judged members by the wrong role, and the same person could have different permissions depending on how they connected.
User Impact
User impact: an OpenClaw ID member's permissions now come from their Gateway profile role, the same as everyone else's.
users.setRole. The member's connections close, and their queued and steered input, subagents, automations and recovered work stop immediately. New requests are checked against the new role. A single request that was already admitted is allowed to finish, matching refactor(gateway): keep operator authority fixed per request #201334.gateway.roles.definitions) is enforced for OpenClaw ID members even withoutgateway.roles.default.gateway.roles.defaultis set, exactly as onmain. A healthy profile whose connection grant is empty keeps the existing scope-upgrade path. The one-time member role import only runs whilegateway.openclawId.enabledis on.Why This Change Was Made
OpenClaw ID is meant to provide connectivity, with the Gateway as the source of truth for authorization. Members now resolve through their linked profile on the same path as every other identified person. Invite approval and Access role changes write the profile role, and the Gateway publishes the effective role name to Discovery as a label. This removes the member-specific special cases that each profile-based check previously had to remember.
Evidence
Compatibility matrix (written first, red on the previous head, now green): a real-Gateway matrix of 31 cells — local owner, shared token/password, trusted-proxy identity, Cloudflare Access identity, OpenClaw ID member, and a member who also connects through a trusted proxy — against no roles, definitions only, definitions plus a default, and an explicit
users.setRoleassignment. Every non-member cell matchesmain(connect result, effective scopes, visible sessions, sending a turn, HTTP owner attribution, owner Web Push); member cells with definitions only are enforced.Enforcement scope, per call site: all 27 production callers of the enforcement switch were classified. Callers that know the person (session sharing, tool invocation, cron admission, channel authority, HTTP/WS profile preparation, device pairing, push targets, PR-read capture, companion RPC, cron wake) resolve a per-person decision: enforce when
roles.defaultis set or the stored profile is a current linked OpenClaw ID member. Callers without a person (global Web Push broadcast, kernel prewarm, visitor-access eligibility, doctor/CLI notes, anonymous pairing preflight) keep theroles.default-only rule. Device-token issuance re-checks membership immediately before credentials are delivered.Real-Gateway tests with members connecting through OpenClaw ID:
sessions.others: "invited"members succeed in all three enforcement modes (enforcement off, permissive default, denying default), and the invited member sees only the invited session.Independent reviews found these issues, all fixed with regression tests:
The latest review found no P0–P2 issues.
CI and ClawSweeper also caught tests still written for the old rule, where the membership role took precedence, plus a few real regressions. All of them are fixed:
To stop finding these one CI round at a time, every test file that references membership roles or the membership ceiling was run locally: 1,614 tests across 91 files pass. They ran in several batches, not one green run. After merging current main (including #201713's recovery-policy checks, now part of the profile-recovery suite), 232 tests across 20 files pass. The latest repair passes 274 tests across 27 files, with the suspension tests unchanged. The member-only scope correction was verified across all 317 test files that reference roles plus 5 regression files (4,734 passing cases); two failures there reproduce identically on the merge base (a cross-device Stop timeout and a restart-marker assertion) and 24 opt-in live-provider, PostgreSQL and Docker cases were skipped. Typecheck, lint, format, line limits and the lifetime-check limit all pass.
Test-line allocation: this PR adds 4,037 net test lines: the standard allowance of 400 plus 3,637 recorded in
config/test-lines-allocations/201526-oid-role-unify.txt. The extra lines cover:main, plus membership-fenced credential issuanceThese are new security behaviors that had no existing tests to extend.
Commands
Also run: every test file referencing membership roles or the membership ceiling, the previously failing CI suites, and the openclaw-id service, publisher, role-presets, role-policy, users, doctor member-roles, browser pairing and Access plugin suites.
🦞 Made with OpenClaw