Repository navigation
feat(gateway): scope guest sessions to explicit invitations - #177257
vincentkoc wants to merge 1 commit into
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 real behavior proof before merge. What this changesAdds opt-in invitation-only session access and lets creators or administrators grant membership through selected human mentions. Example: Alice invites Bob to agent:main:marketing while agent:main:credentials remains unrelated.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 7 items remain Keep open: this maintainer-authored PR addresses a concrete collaboration need, but the newly documented guest configuration is rejected by Visitor Access. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe Gateway combines authenticated profiles, role policy, session metadata, and canonical membership to authorize session discovery, reads, mutations, resources, and events. flowchart TD
A[Selected human mention] --> B[Committed input owner]
B --> C[Current invitation policy]
C --> D[Membership and watermark transaction]
D --> E[Committed sharing facts]
E --> F[Session reads and events]
F --> G[Guest connection]
Technical reviewBest possible solution: Keep the opt-in mode on the existing membership owner, align Visitor Access with it, and qualify the complete grant-and-revoke flow. Do we have a high-confidence way to reproduce the issue? Source establishes both the missing invited-only mode on current main and the Visitor Access rejection of the revised example; no target code was executed. Is this the best way to solve the issue? Reusing canonical membership and its committed publication owner is appropriate, but the bundled Visitor Access consumer must support the new role value in the same change. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c7b896dbb137. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Durable mention-based grants change a security boundary whose final-effect behavior is not yet demonstrated. EvidenceSecurity concerns:
What I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 Reviewed October 19, 2026, 6:58 AM ET / 10:58 UTC. |
|
Superseded by 13 narrow, dependent draft PRs for review.
The stack fixes Visitor Access role acceptance, targeted Inbox invalidations, invitation ownership after run completion, atomic transcript/membership/watermark persistence, the HelloOk cap, and the administrator media exception. It also covers approved-input recovery and retained membership publication. Validation: 448 focused tests, each intermediate branch's core typecheck, affected UI/test/plugin types, scoped lint/format checks, and the packaged runtime/UI build passed. The final tree matches the validated source. The root still conflicts with newer main; restacking, hosted CI, live Team-server and latest-stable upgrade qualification remain before landing. Closing this monolithic draft in favor of the linked stack; its branch and discussion remain available. |
Fixes #135631
What Problem This Solves
Guest roles currently have no invitation-only session view: allowing foreign-session reads exposes unrelated conversations, while
sessions.others: "none"also blocks explicit members.User Impact
Operators can set
gateway.roles.definitions.guest.sessions.othersto"invited", assign the intended profiles, and reconnect them. Guests see their own sessions and foreign sessions where they are members. A creator or administrator can invite a guest by selecting a human @mention and sending the message.Review decision: public access continues through existing sanitized published transcript links. Ordinary shared visibility does not put a session in a guest's sidebar or expose its raw history and files.
Existing role definitions keep their behavior. Invitation membership does not grant operator scopes:
operator.sessions.writestill permits changes to the caller's own sessions only. No live server configuration is changed by this PR.Why This Change Was Made
Use the existing session membership store as the authority across lists, search, direct reads, events, and session resources. Apply the cap even to broad read/write connections; administrators retain their existing access.
Only a creator/admin's selected mentions in the committed original human input grant membership. Plain text, assistant output, rejected selections, and other participants cannot invite. Draft/incognito restrictions remain in force. Removing membership revokes access, and replaying an old message cannot restore it after a restart.
Membership and the existing mention watermark commit together without a schema-version change. The composer explains invitation behavior, and the sender receives a visible notice if a post-ACK invitation cannot be confirmed.
Evidence
pnpm buildpassed.Real Control UI against a synthetic Gateway fixture.
Before:
After:
A post-ACK invitation failure stays visible to the sender:
Implementation and validation scope
The production increase implements one permission boundary and carries canonical membership through its existing readers; it does not introduce a second ACL store. Production +621 LOC; tests +635 LOC; docs/generated metadata +41 LOC.
Focused coverage includes broad and session-only scopes, membership removal, draft changes, cache/event filtering, queued-input commit, approval rewriting, non-manager attempts, transaction rollback, restart/replay, and visible failure reporting.
Independent P0/P1 autoreview found no findings. Subsequent fixes address validation fixtures, typing, lint, and the mobile event-coverage declaration.
Validation used the repository's
run-vitest,run-tsgo-core-test-shards, and scopedrun-oxlintwrappers, plusprotocol:check,check:protocol-coverage,config:docs:check,ui:i18n:verify,lint:docs, the line-cap ratchet, andpnpm build.The local Testbox wrapper could not load its pinned tooling. Remote validation used the installed CLI on the same Testbox, with candidate file hashes verified before and after execution. The build covers the final production source; the subsequent change only types a test assertion without changing its expected behavior.