Repository navigation
feat(auth): enable guests to access sessions through selected mentions - #184515
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 enables invitation-only roles and grants session membership when a creator or administrator commits a selected human mention. Example: Alice selects Bob in a shared conversation with Bob’s role configured as sessions.others: "invited".
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR completes useful invitation-only guest access that current main cannot enable. No actionable introduced defect was found; the exact-head CI gate remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway authenticates human chat input, prepares invitation authority, and sends it to the existing transcript transaction owner; committed membership then controls session discovery, reads, events, and attachments. flowchart TD
A[Selected human mention] --> B[Authenticated chat input]
B --> C[Invitation policy]
C --> D[Transcript transaction owner]
D --> E[Committed membership]
E --> F[Session reads and media]
D --> G[Mention Inbox notification]
Technical reviewBest possible solution: Complete the opt-in activation through the existing input, transcript, membership, and media owners after the exact-head CI gate passes. Do we have a high-confidence way to reproduce the issue? This is feature activation: current main’s native schema rejects invited, while the supplied acceptance results exercise selected-mention grants and unrelated-user exclusion. Is this the best way to solve the issue? The change uses the existing policy and transaction owners, preserves existing settings, and keeps notification delivery separate from committed membership; no smaller missing production boundary was identified. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5275f4391911. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +281, Tests +3510, Docs +42, Generated 0, Other +2. Total +3835 across 52 files. Added test files: 11. 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 (9 earlier review cycles; latest 8 shown)
Reviewed November 16, 2026, 11:18 PM ET / November 17, 2026, 04:18 UTC (Revision 10). |
26daf71 to
6134c65
Compare
344ee8b to
6a1e79a
Compare
01f0f9c to
385c716
Compare
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
47b8b44 to
3671982
Compare
e6193da to
10d2413
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Preserve existing none/view defaults and main coverage. Forward the reauthenticated Gateway profile during native queued replay so committed invitations retain their real requester. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: jalehman <[email protected]>
The enum activation makes these two pre-activation expected errors obsolete. Keep all four runtime assertions and decrease the allocation by exactly the two removed comment lines. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: jalehman <[email protected]>
10d2413 to
3e08c1f
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Revalidate current sender and recipient authority without comparing caller transcript descriptions. Consume the sharing owner entry for media membership, and remove a redundant caller-side incarnation comparison. The new ownership regression fails before and passes after this repair; writer-side fencing and demotion rollback remain enforced. Test allocation is exactly 3,105 lines above the standard 400 for net +3,505, including this required regression. The identity allowlist is unchanged. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: jalehman <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
Team guests need their own sessions, explicitly invited sessions and sanitized public links without discovering unrelated conversations.
User Impact
Enables opt-in
gateway.roles.definitions.<role>.sessions.others: "invited"after the preceding read guards. A creator/admin selecting a person in a committed original message grants session membership. Plain text, replay and later Inbox delivery cannot grant access.Visitor Access accepts the documented role for invitations and renewals. Ordinary invited readers need session access for attachments; real administrators retain standalone media access.
Why This Change Was Made
Prepare invitation authority at the authenticated human-input owner, retain approved offsets through recovery, and commit membership with the original transcript write. Retained readers observe the committed membership. Inbox notification failure has a visible outcome and does not undo a committed message or cancel agent dispatch.
Stack step 17/17, based on invitation UI wording. Review and merge in stack order. This PR owns full-stack integration coverage; preceding PRs retain their narrow production boundaries.
Contributor credit: @vincentkoc (PR author), with @jalehman (stack owner).
Work sessions
Linked for team reference; these sessions aren’t public.
Evidence
Current CI repair — November 17
Landed November 17: exact reviewed head
488654e4ec99930cfefeffe73d014329a7049181merged as 62a982bb24b5. Final CI and requiredopenclaw/ci-gatesucceeded; the exact-head hosted review is Ready with no findings or before-merge items. Native replacement recovery used existing completed hosted CI, with no new CI dispatch, compute lease, writer switch or gate bypass. The landed commit retains exactly one credit trailer each for @vincentkoc and @jalehman.Replacement candidate
488654e4ec99930cfefeffe73d014329a7049181repairs the PR-caused session-identity ratchet failure. The previous pinned auto request was explicitly retired through its native owner before this head was published; it was not overwritten or re-armed blindly.The permission hook now revalidates the current sender and approved recipient authority, leaving transcript/view preconditions with the existing session-store writer. A redundant caller-side transcript comparison is removed. Invited media policy consumes the prepared sharing owner's authoritative entry and membership instead of comparing two caller-side incarnation IDs. The identity allowlist is unchanged; the exact session-identity check now passes.
A new regression failed before and passed after this repair: refreshing descriptive caller metadata must not become an authorization refusal, while changing recipient eligibility still refuses the invitation and the original writer precondition remains intact. The affected repair run passed 87 cases with one stale error-text expectation; that expectation was corrected, and the failed case, new regression and all four actor/non-actor authority cases then passed (6 targeted cases). The media/resource cases were already green and unchanged by that expectation correction. No unresolved product assertion failure is hidden by a passing replay. The actual native composer flow passed 3/3 again on the repaired source. Core/methods types, scoped typed lint, committed diff, test-line and session-identity checks passed; fresh independent review of the repair is scoped-clean.
Net test growth is +3,505, standard allowance 400, exact credit 3,105, including this required regression; the reason is also in the squash body. No identity-ratchet allowance, protocol/schema version, default or permission gate was raised. The prior native AWS proof stays pinned to its original head/base below; no new lease or workload replay was used. Fresh replacement-head CI and the requested hosted review are tracked separately from the prior failed run.
Pre-repair integration qualification — 3e08c1f
Candidate
3e08c1f23dd553c2a109824cfb334138b354353fis based on054fd9788bc0f86303e161ca3b2ab36a1ed8cd65. The new conflict was resolved by retaining main'sadministratorMemberPolicyalongside membership-awarecanRead/canInvite, and preserving main's origin-owned continuation recovery. Main intentionally retired the large hello update-scope suite in #198943; this PR does not resurrect it. Canonicalframes.auth.test.tsretains and passes the transport-schema cases, includinginvited.On this candidate, 117 affected cases across 13 files passed, covering the seven guest consumers, selected-mention commit/replay/failure paths, current member-administrator policy, recovery authority, actor/non-actor transcript custody, native role config and canonical hello auth schemas. The actual native composer flow passed 3/3 again for
none,viewand explicitinvited, with committed access, outsider exclusion, HTTP JSON/SSE, stop/start persistence and next-request revocation. Core/methods types, scoped lint/format, validators, canonical config-doc checks, committed diff checks and the exact test-line ratchet passed. Fresh independent P0–P2 review is scoped-clean.Net test growth is now +3,484, with standard allowance 400 and exact allocation 3,084; the three-line reduction follows the upstream test consolidation. All remaining current-main tests are retained. The task-only browser driver is retained as evidence outside the checkout and is not shipped. The AWS execution below remains pinned to its actual tested head/base; it is not relabeled as a November 17 execution. Current mention/recovery/schema integration was requalified with the affected real-Gateway and native UI checks above. Final-head CI and one hosted re-review remain required before landing.
November 16 integration qualification — 10d2413
Prior candidate
10d24137b2562eb108b01f230851da3d69005da4is based ona139d420834e6e04641303c79eb7c6e0e4444fa5. While AWS qualification ran, main advanced and conflicted only in generated config hashes. The canonical generator resolved that conflict. Range-diff shows no invitation-production delta; every production file changed by this PR is byte-identical to AWS-qualifiede6193da7. Dependency and agent DB schema-version inputs did not change. The AWS proof below remains explicitly pinned to its tested head/base, not relabeled as a new-tree execution.After integration, 41 focused cases across 10 files passed, including all 30 guest/resource/mention cases and main's new transcript-memory/skills consumers. The real native composer flow passed again 3/3 on this final candidate. Core/methods typechecks, scoped lint, all validators, exact test-line ratchet and committed diff checks passed; fresh independent P0–P2 review completed scoped-clean. The retained task-only browser driver was removed from the checkout and is not shipped in the PR. The earlier 444-case qualification is recorded separately below. Exact final-head CI and hosted re-review remain required before merge.
Pre-conflict qualification — e6193da
Tested revision
e6193da716b1107e7b4375698fa76a13731d553awas replayed onto60c112a1bfa94ea4a5d43e4302e18375429d879f, after merged #184514. Range-diff preserves the original activation slice. The enum now lives in main's extractedsrc/config/zod-schema.gateway-roles.ts; main's OpenClaw ID connection ceilings, mention ranking/display identity and recovery-unavailability handling remain intact. Generated config metadata was regenerated, not hand-edited.none,viewandinvited, through actual picker selection and Send, committed access, outsider exclusion, HTTP JSON/SSE, Gateway stop/start and next-request revocation. No enum/auth overlay is used.mentions.failedwithout undoing committed input/membership or failing dispatch. Native queued replay forwards only the profile reauthenticated by the existing Gateway recovery owner; its two invitation regressions failed without that handoff and pass with it.invitedtogateway.roles.definitions.<role>.sessions.others; extend Visitor Access eligibility to explicitly configured invited roles; regenerate config documentation hashes. No new key, shipped default change, DB schema/version change, protocol-version bump, Doctor transform or config migration. The already registeredmentions.failedevent is now emitted to the original sender’s connections on post-commit notification failure, carryinggatewayInstanceId,sessionKey,agentId,messageIdand a fixederrorMessage; no new RPC or event schema is introduced. Existing absent/none/view behavior remains unchanged.config/test-lines-allocations/184515-guest-invitation-access.txt. All current-main tests are retained. Two obsolete pre-activation expected-error comments were removed without removing assertions.AWS native acceptance — November 16
Head
e6193da716b1107e7b4375698fa76a13731d553aand base60c112a1bfa94ea4a5d43e4302e18375429d879fboth built successfully on one isolated AWS c7a.8xlarge (measured 32 CPUs / 62,909 MiB), with Node 24.22.1 and pnpm 12.15.0. The native config is used without an enum/auth overlay. The identical task-only browser driver and fixture bytes were injected on the base only after its clean production build.none, head and baseview, head and baseinvited, headmentions.failedwithout failing idle or queued dispatch.The AWS runs completed 3 head browser cases + 2 base comparison cases, 30 real-Gateway/resource and dispatch-failure cases across 8 files, and two CLI Doctor upgrade cases: frozen released-schema preservation and a replay through the actual stable 2026.11.4 CLI before candidate
none → invited → invited. Memberships, exact retained transcript bytes and hidden-profile mention watermarks are preserved. This is isolated service stop/start and CLI upgrade proof, not a deployment or crash-reboot claim. No live Team Gateway configuration or deployment was changed.The workload exited 0. Its complete evidence archive was downloaded and all 19 artifact hashes verified; head/base driver-input hashes match. Archive SHA-256:
a4abbe5737b07ef80deccaea6f897033b2a6ad67974075edcb075626692abbef.Provider recovery and cleanup verified: the workload originally exited 0 but the CLI wrapper exited 7 after coordinator finish/release/inspection requests returned HTTP 401. After access returned, the missing original receipt was inspected and recovered using its unchanged signed finish file, signer and finish hash—no workload replay or replacement lease. A fresh server read verifies the original terminal receipt with exit 0. Normal release succeeded, and authoritative inspection reports
state=released,hasHost=false,ready=false,cleanupStatus=completeandprovisioningResourceMayExist=false(cleanup completed November 16, 14:57:58 UTC). The retained archive checksum still matches after release, and local owned SSH transport termination is confirmed. Verified run record; leasecbx_da8d965348dd. This task changed no credentials, account, provider or live Gateway configuration to recover it.Interrupted earlier qualification
At
f9377634, exact-head CI and its CI gate succeeded. The November 14 AWS run reported successful head build, frozen-schema Doctor upgrade, actual stable 2026.11.3 Doctor upgrade and all three native public composer scenarios before controller transport was interrupted (exit 255). Base proof and the remaining boundary run were not collected as completed; this is partial evidence, not full-stack AWS success. Leasecbx_e030bc31ff62was subsequently verified expired with no host or possible remaining provisioning resource, cleanup timestamp November 14 09:21 UTC. The November 15 local continuation ended by SIGTERM/143, not a product assertion; those incomplete gates have now been rerun to terminal receipts above.Earlier stack qualification (historical heads, not current-head proof)
Final integrated source:
47b8b4485615af059ec8d93047057099289a57f7, on fixed main5bf0c41a03f1dba03d625460607ed5b959710458. All 18 post-base commits are signed. The rebase preserves main's Access-program grants and runtime-label filtering, adopts its canonical Doctor/lifecycle/harness fixtures, and removes duplicate prerequisite fixes. Canonical config metadata is regenerated. Prefixes are not separately built locally; current-head CI and review receipts are recorded on each PR.Qualification
The complete integration matrix passed 46/46 across 13 files and four configurations under pinned Bun in 374.85 seconds, at the previous published head
ddc49fd63d3b82e41eb6c74af4ad935a56aebc8f. This is pre-rebase proof, not a claim that these local results ran at the new head.{"head":"ddc49fd63d3b82e41eb6c74af4ad935a56aebc8f","result":"pass","runtime":"pinned Bun","files":13,"tests":46,"transport":"authenticated TLS/WebSocket and HTTP","provider":"loopback fixture","scope":"complete guest-access stack before fixed-main rebase"}Before the rebase, eight affected type graphs passed: core, agent/session, config/CLI, Gateway root, Gateway server, Gateway methods, messaging and Doctor commands. Typed lint, formatting and line caps passed. Current source passes
git diff --check; the canonical worker inventory reports 695 non-test files / 2,482 call expressions with unchanged classifications.The pre-rebase Doctor/session-visibility fixtures passed 45/45 under pinned Bun in original order; session-read and conversation-capture fixtures passed 39/39 under Node. Main now owns the Doctor repair. The callback-retention regression failed 2/4 before the fix and passed 4/4 afterward, including collected inputs. Scoped autoreview completed with no actionable P0–P2 findings; an independent source review found no introduced defect, including the overlapping main changes.
Runtime coverage uses canonical profiles, membership stores and resource owners:
These are call-through pauses at production boundaries, not replacement authorization guards. Event/process fixtures are synthetic. The provider case exercises the production runtime caller, not the authenticated WebSocket fork entry. The GitHub case reads a persisted canonical receipt and makes no GitHub API call. UI captures establish wording/layout only.
CI fixture repairs
Three separate prerequisites repair the failures found during qualification:
The earlier fixture-repair qualification passed Tooling and Gateway-server typechecks and scoped typed lint. The ACP correction passed formatting and the canonical test-line ratchet; scoped autoreview found no actionable P0–P3 findings. This restack preserves all production changes and downstream source patches. Its only additional source change is canonical ACP fixture ownership with native-handle retirement assertions, plus the measured three-line correction to prefix ceilings. Final tree:
3bf325279a93b2437f4051ba172033f45a172ffb. Local results are scoped evidence; each revised prefix also has passing hosted CI and a source review with no actionable findings at its published head.Earlier build and upgrade qualification
At
5cd3488508bfbd52b4c59ad7736f84831e60ed22, the full QA build passed in 288.09 seconds, including declarations, plugin/runtime packaging, CLI bootstrap, SDK export resolution and Control UI budgets. Seven affected type graphs, 29 RPC cases on both Node and pinned Bun, and 74 integration cases under pinned Bun passed. The real built CLI upgrade passed under both engines, preserving memberships, exact transcript bytes and the hidden-profile watermark throughnone → invited → invitedusing the v2026.10.7 schema and real doctor commands. This is CLI upgrade proof, not npm-install or deployment proof.The later guest-access production repair releases settled invitation callbacks and moves their binder within the existing live-owner module; the 46-case integration run qualifies that lifecycle change. The new main rebase also preserves upstream production changes. Dependency, packaging and public export inputs are unchanged; the current-head hosted CI run linked below supplies the final prefix qualification.
Retained broader regressions: 102 cases across six files at
63c46cb89897c1e6fe496d55af5f42c152506b0c, and 136 passing cases across 12 files at979ff80bf2e59f7ea0a10c2ec4ce6ffbb045f6b4. These cover notification failure, ticket revocation, cold transcript restoration, actor residency, subagent completion, private-session reads, mixed durable/private usage and eight forged-SDK-options paths. The latter run's failing cleanup fixture is fixed in the prerequisite and subsequently passed 17/17 on both engines.The unmodified SDK surface gate failed at both the runtime-qualified revision and merged base: 160 entrypoints > 158, 3,832 exports > 3,818, 2,223 callable exports > 2,214. Neither reported unauthorized removals from v2026.10.7. Matching counts are not proof of identical exports; this remains recorded baseline debt. No SDK budgets were raised. The separate, measured test-line allowance is documented below.
Review follow-through
The retention finding is fixed in the transcript owner. Actual terminal release clears the closure; collected inputs retain live source checks; unknown-outcome custody remains intact. The new integration matrix closes the requested publication/resource coverage gaps.
Earlier fixes remain: broad question preparation includes membership; public SDK options cannot supply invitation authority; post-commit Inbox failure reports failure while preserving dispatch. The concurrent RPC publication repair retains its authorship and unrestricted retired-store deduplication.
Named follow-up: the delivered-event thinking-claim CI failure did not reproduce in paired full-file runs on the same Bun pin: 3/3 at parent
0430e197cfca4233e76fbaccae4e6536bf37b19aand 3/3 at event head0db3b01bf4e02cdab7fb7cd4d5833dfe201993bb. Its owner/callers/fixture are unchanged and bypass the changed broadcaster. Local macOS proof does not establish the Linux CI cause; investigate claim retirement if it recurs.Trusted local qualification followed the unavailable Testbox allocation, which ran no tests. Current-head hosted CI and review remain required before landing.
Current-head qualification
Required CI passed at
47b8b4485615af059ec8d93047057099289a57f7. The ClawSweeper review covers the same head and reports no actionable findings or required rank-up moves. Merge in the recorded stack order.Change size
Current restack: 52 files, +4,126/-291. Historical prefix accounting: production +392/-117; tests +3832/-808; docs +53/-11; generated +2/-2.
Positive production LOC adds the invitation authority boundary and opt-in role capability. No new config key, changed existing default, SQLite schema-version bump or protocol-version bump. Enable
invitedfor the intended role and reconnect its profiles. Existingviewroles remain supported. Public access means the existing sanitized public transcript link.Fixes #135631. Context: #135631.
Stack order
Historical test-line allowance (superseded above)
config/test-lines-baseline.txt: 6,284,088 → 6,287,107 (+3,019). Adds the real-owner integration matrix and upgrade coverage, while removing replaced synthetic cases. The allowance includes test-support files and uses the canonical full-tree counter. The ceiling equals this prefix's measured 6,287,107 test lines; no spare allowance is added. This is a bounded baseline exception under the repository testing workflow, not a functional-test waiver. No runtime assertion, SDK budget or required CI check is weakened. Change-size test counts include the baseline metadata edit.Across the open stack, the test-line ceiling rises by 4,868: 4,396 measured net test lines plus 472 already present on the fixed main. Each increase is folded into its owning slice; assertions and runtime behavior are unchanged by the budget edits.