Skip to main content
Session sharing lets more than one authorised client attach to the same live Gateway session β€” watching an agent work a task together, or opening the same conversation on desktop and mobile.

Quick Start

1

Default β€” private, 1:1 (nothing to configure)

Today’s behaviour is unchanged. A session is PRIVATE and stays bound to its single owner.
2

Share a session read-only

Set READ_ONLY so an extra client may attach as a VIEWER to watch the transcript, but not send.
3

Share a session for co-driving

Set SHARED so an extra client may attach as a MEMBER and co-drive β€” sending turns alongside the owner.
Sharing is additive. A PRIVATE session keeps a single OWNER observer β€” everything that worked before still works.

How It Works

Two clients attach to one session, a turn fires, and both receive the stream β€” but a viewer’s send is rejected.
  1. The owner starts a session β€” it is PRIVATE by default.
  2. Raising visibility to SHARED or READ_ONLY lets a second authorised client attach.
  3. Each attached client holds a role: OWNER, MEMBER, or VIEWER.
  4. The turn stream fans out to every observer, filtered by their OperatorScope.

Visibility

Visibility decides whether a second authorised client may attach on top of scope authorisation.

Roles

A role decides what an attached client may do inside a shared session.

Which visibility should I pick?


Configuration

Every value maps to a wire string used on the protocol.

SessionVisibility

SessionSharingRole

All imports use the friendly top-level path:

User Interaction Flow

Alice starts a research session on her laptop, opens it read-only on her phone to watch tokens stream, then Bob joins as a MEMBER to help steer the next turn.

Observer Protocol

SessionObserverProtocol is the @runtime_checkable contract every client agrees on for attaching, detaching, and enumerating observers.
attach adds an observer rather than re-pointing ownership β€” a PRIVATE session still keeps its single OWNER.

Interaction with Operator Scopes

Visibility and role layer on top of OperatorScope β€” they are not authorisation. An observer without the READ scope receives nothing regardless of role, and a MEMBER still needs WRITE to send. Visibility gates whether a client may attach; scopes gate what they may do once attached.

Gateway Operator Scopes

Role-based access control that visibility and roles build on top of

Best Practices

Keep sessions PRIVATE unless a real collaboration case exists. Sharing is opt-in and additive.
Pick READ_ONLY for supervisor, audit, or multi-device watching. Reserve SHARED for teammates who truly co-drive.
Call detach when a client drops so the observer set stays clean and fan-out stays cheap.
Visibility is not authorisation. Pair sharing with scopes so an observer without READ receives nothing.

Operator Scopes

Least-privilege RBAC that sharing layers on top of

Session Continuity

One owner reconnecting to one session

Session Persistence

Durable session state across restarts

Handshake Protocol

Version negotiation and connection setup