Repository navigation
fix: preserve ID member ownership of connected apps - #196496
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 preserves OpenClaw ID member identity and role limits through connected-app consent, delegated access, and recovery. Example: Alice is an OpenClaw ID operator on a token-authenticated Gateway without gateway.roles.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs member ownership and bounded app authority; no actionable code defect was found, while explicitly deferred required checks remain failed. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe MCP relay translates authenticated callers into app grants; Gateway ingress and recovery combine those grants with current membership authority before RPC, browser access, and agent effects. flowchart TD
A[Authenticated member] --> B[Relay consent and app grant]
B --> C[Gateway principal ingress]
D[Live membership authority] --> C
C --> E[RPC and browser access]
C --> F[Recorded recovery source]
F --> G[Recovered agent authority]
D --> G
G --> H[Guarded filesystem effect]
Technical reviewBest possible solution: Preserve authenticated member ownership through the existing grant, membership, ingress, and recovery owners while leaving required CI gates enforced. Do we have a high-confidence way to reproduce the issue? Current-main caller selection and ingress policy expose the roleless-member failure, supported by supplied base-red/head-green output; this review executed no target code. Is this the best way to solve the issue? The patch is a focused repair: identify the authenticated person independently of global auth configuration, propagate the existing membership principal, and require original app consent during recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3027457406b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +21, Tests +210, Docs +5, Other +3. Total +239 across 12 files. Added test files: 0. View PR surface stats
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. Review metrics
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 (1 earlier review cycle)
Reviewed November 10, 2026, 3:13 AM ET / 08:13 UTC (Revision 2). |
|
@clawsweeper re-review The PR body now embeds sanitized original browser/runtime receipts and red/green terminal output. A supplemental four-process run uses token authentication without local roles throughout, verifies actual writes before and after reopening state, then removal during model work with zero filesystem write-boundary visits and no file effect. It also checks retained/fresh request denial, original-source restoration denial and an independent control after another restart. Please recheck the previously requested behavior proof within the stated source/runtime limits. Production head remains |
|
🦞👀 Re-review progress:
|
* fix: preserve ID member ownership of connected apps * chore: align app regression budget with CI merge tree
PR openclaw#196173 already reconciled the inherited test-line debt. Keep openclaw#196496 allocation at its exact 210 regression lines instead of counting 70 inherited lines twice. Production and test LOC are unchanged.
What Problem This Solves
Fixes connected-app ownership and access for OpenClaw ID members on Gateways using token authentication without local roles.
User Impact
Members manage their own connected apps. Direct app requests, browser access and original-source recovery retain the approving member’s role limits and original approval; removing that membership denies those paths. Existing owner and administrator controls remain covered.
Why This Change Was Made
Select the authenticated person independently of global Gateway auth configuration, then carry the existing membership principal through delegated ingress and recovery. Recovery requires the original app grant as well as current membership. Reuse existing authority owners; no new configuration, schema, or migration.
Evidence
Regressions fail on the base for roleless ownership and ingress. A separate recovery regression catches fallback from an app without a resumable grant to direct-device recovery. All pass with the repair.
Focused Gateway/auth/recovery and relay ownership suites: 135 tests pass. Unchanged relay service/grant-binding sibling suites: 43 tests pass. The settled ingress suite passes all 10 tests in 19.09s (22.27s through the wrapper).
Gateway and plugin typechecks, targeted lint/formatting, docs links, and diff checks pass.
Isolated Chromium composition passes actual issuer/Discovery/loader/native tunnel/Gateway flows: member invitation and approval, own-app consent/revoke, owner-grant protection, signed removal, denied reconnect, and an owner app that stays usable.
Supplemental isolated native composition passes four separate token-authenticated Gateway processes with no local roles: actual member consent and agent file writes, persisted original approval, normal-startup recovery, signed removal, denial before and after another restart, and an independent member app that stays usable. The harness waits for public
/startupzsuccess before session mutations; earlier setup failures are retained privately.Runtime proof uses retained Gateway
78b4d953plus all eleven pinned admission/relay/recovery modules matching this candidate. It uses a local MCP relay fixture and deterministic model fixture. The browser mounts the production consent component through a narrow host adapter; full Control UI routing, full-current-main packaging, deployed builds, and automatic queued-job resumption are not qualified by these runs. No live services were changed.Independent OpenAI autoreview of the full local candidate against
e95289326a7907f6ce926afbb4e81a03bbedef98, P0–P3: scoped-clean, no actionable findings (static review). Subsequent edits were mechanical test/lint and allocation metadata. Local ClawSweeper was unavailable. Hosted follow-up review completed on head6b3402c68a36e4f99ed0f22681e997011951ec95: no actionable findings, real behavior proof sufficient, ready for maintainer review. The embedded browser and supplemental four-process execution excerpts resolve its earlier proof request. This summary update changes no code or proof.Current-head main CI completed with 43 successful jobs, 26 skipped and two failures: the test-line ceiling check and its downstream CI gate. The initial branch allocation drift was corrected from 281 to 280 and independently reproduced green against that CI merge. The later CI base already exceeds its ceiling by 293 lines; this branch adds 210 test lines and 280 allocation, leaving 223 lines of inherited debt. That remaining blocker is deferred; no further allocation increase is proposed.
Current-head OpenGrep, CodeQL quality, and all six CodeQL security shards failed with GitHub installation API rate-limit errors. These scanner gates remain unresolved. The prior-head OpenGrep SARIF contains zero findings and one parser warning on an unchanged test-only nested generic; this does not establish current-head or full test-file scanner coverage.
The simplify pass retains existing membership and app-grant owners and removes the configuration-dependent identity fallback. Net change: 21 production lines and 210 regression-test lines. The 280-line allocation covers those regressions plus 70 lines of inherited ceiling debt in the original qualifying CI merge tree; the shared ceiling is unchanged.
Sanitized execution evidence: browser ownership and regression output
These are allowlisted excerpts of original runner receipts and terminal output. Identity IDs, grant IDs, keys, endpoint addresses and private filesystem paths are omitted. Receipt hashes identify the original captured bytes; they are not independent execution attestations.
The Chromium run used token authentication without local roles. It exercised the production Connected apps component and Gateway client over the actual loader/native tunnel, including attempted revocation of an existing owner grant, normal own-app approval/revocation and signed member removal.
{ "gateway": { "status": "passed", "localRolesConfigured": false, "ownerGrantBeforeBrowser": true, "browserMemberApprovedCanonical": true, "browserConsentApproved": true, "memberAppUsable": true, "memberAppRevoked": true, "browserMemberRemovedCanonical": true, "removedMemberAppDenied": true, "ownerAppStillUsable": true, "ownerGrantAfterBrowser": true, "ownerGrantRevokeNotified": false }, "browser": { "status": "passed", "auth": { "method": "trusted-proxy", "role": "operator", "scopes": [ "operator.read", "operator.write", "operator.approvals", "operator.questions", "operator.talk" ], "roleAllowsAdmin": false }, "memberCaller": { "kind": "person", "canAdmin": false, "canPair": true }, "ownerGrantProtected": true, "ownerRevocationDenied": { "error": { "code": "UNAVAILABLE", "message": "Connected app not found. Refresh the list and choose one of your apps.", "details": { "code": "not_found" } } }, "ownAppRevokedViaComponent": true, "appApprovedAndUsable": true }, "originalReceiptSha256": { "gateway": "2e42d97b02a4d6625391736767ddd730ddb06034727f9af8a933132eda25f93d", "browser": "286f397113fc4d286f2d5270843bbe5b936a1abc33cb14dd6f5de5c2c90b693a" } }Original ingress regression on the base, recovery regression before the additional no-grant correction, then final passing focused/sibling output:
Sanitized execution evidence: token authentication without local roles, writes, removal and reopening state
This supplemental run uses token authentication without
gateway.rolesin all four processes. The local observer alone holds the owner token; member sessions use actual native OpenClaw ID admission. It reuses the eleven exact candidate source modules at head6b3402c68a36e4f99ed0f22681e997011951ec95in retained Gateway78b4d953.Phase 1 performs actual member consent and an agent file write. Phase 2 reopens SQLite/plugin identity, performs another allowed app write and restores the original app source through the normally registered recovery owner. It then starts another real app request, waits for its model request, submits signed removal through actual Discovery, and checks termination before the filesystem write boundary. The run ends with
status:error, zero successful write tools, zero visits to that write boundary and no output file. The retained restored source becomes invalid; both retained/fresh app requests and fresh original-source restoration are denied. Phase 3 reopens after removal and verifies those denials plus the independent control again. Denied app requests never reached the provider.The following values are selected directly from original execution receipts; the two allowed 60-byte files were independently read and hashed after all owners closed. Canonical persisted member state and Discovery publication were independently checked at sequence 4.
{ "status": "passed", "startedAt": "2026-11-10T08:02:34.001Z", "finishedAt": "2026-11-10T08:06:33.319Z", "runtime": { "bun": "1.4.4", "platform": "linux", "arch": "arm64", "node": "v24.22.2" }, "distinctGatewayProcesses": 4, "phases": [ { "phase": 0, "pid": 43, "status": "passed", "gatewayAuthMode": "token", "localRolesConfigured": false, "observerAccessFixtureLookups": 0, "startupAdmissionReady": true, "finalAuthoritySeq": 1, "ownersClosed": true, "originalReceiptSha256": "14d2e3160a013fb5bcd919fa3da998621758a99e378f01f79d0b34a222538189" }, { "phase": 1, "pid": 123, "status": "passed", "gatewayAuthMode": "token", "localRolesConfigured": false, "observerAccessFixtureLookups": 0, "startupAdmissionReady": true, "realAppAgentWrite": true, "principalBackedRunSnapshot": true, "controlAppUsable": true, "finalAuthoritySeq": 3, "ownersClosed": true, "originalReceiptSha256": "429e08f6e6f3afd747e20036c6b440d4a680215358bc20185c4fcb420e4d979d" }, { "phase": 2, "pid": 297, "status": "passed", "gatewayAuthMode": "token", "localRolesConfigured": false, "observerAccessFixtureLookups": 0, "startupAdmissionReady": true, "realAppAgentWrite": true, "principalBackedRunSnapshot": true, "originalSourceRestoredByNormalStartup": true, "inFlightProviderObservedBeforeRemoval": true, "inFlightAfterRemoval": { "status": "error", "successfulToolNames": [], "writeBoundaryVisits": 0, "fileAbsent": true }, "inFlightWriteDeniedAfterRemoval": true, "discoveryRemovalApplied": true, "publishedRemovalReadBack": true, "restoredSourceInvalidated": true, "removedAppRequestsDenied": true, "deniedRequests": [ { "op": "status", "ok": false, "code": "unavailable" }, { "op": "message.send", "ok": false, "code": "unavailable" }, { "op": "status", "ok": false, "code": "unavailable" }, { "op": "message.send", "ok": false, "code": "unavailable" } ], "deniedRequestsReachedProvider": false, "freshOriginalSourceRestoreDenied": true, "controlAppUsable": true, "finalAuthoritySeq": 4, "ownersClosed": true, "originalReceiptSha256": "25cdc643ea23ffcba99ebfc522ecb2f6ac076b30c0d697339ca0e882d94fffda" }, { "phase": 3, "pid": 474, "status": "passed", "gatewayAuthMode": "token", "localRolesConfigured": false, "observerAccessFixtureLookups": 0, "startupAdmissionReady": true, "removedAppRequestsDenied": true, "deniedRequests": [ { "op": "status", "ok": false, "code": "unavailable" }, { "op": "message.send", "ok": false, "code": "unavailable" }, { "op": "status", "ok": false, "code": "unavailable" }, { "op": "message.send", "ok": false, "code": "unavailable" } ], "deniedRequestsReachedProvider": false, "freshOriginalSourceRestoreDenied": true, "controlAppUsable": true, "finalAuthoritySeq": 4, "ownersClosed": true, "originalReceiptSha256": "0275ee6a3fec1194df26fbae293360f691195674294097559a070220833dd746" } ], "actualFilesVerified": [ { "phase": 1, "bytes": 60, "sha256": "5771a9717be8e153c06c22d03ec08f8678a0a9552b160be30de514c7e0a1c895" }, { "phase": 2, "bytes": 60, "sha256": "b41973f08dfc1b77a3b0eaaabb563eb84011dec5c0c67edab90d5e5ebe471833" } ] }Proof boundary: actual issuer/Discovery/Gateway/native admission/bundled plugin and real agent filesystem effects, with local external-relay and deterministic SSE-model fixtures. Standalone Bun uses
NODE_ENV=testfor the existing passive filesystem observation hook, without Vitest or authority mocks. Recovery registration is normal plugin startup; the harness explicitly consumes the recovery API. This does not qualify automatic queued-input resumption, a full current-main package/deployed build, Node packaging, full UI-shell routing, or hosted services. No live service changed.The remaining CI/scanner blockers above are deferred under maintainer direction and remain visibly failed; this evidence does not claim scanner clearance or authorize merging.