Skip to content

Amend AIT-ST1/CT1 for client + channelName API#467

Open
zknill wants to merge 2 commits intoai-transport-featuresfrom
zak/ait-718/accept-realtime-client
Open

Amend AIT-ST1/CT1 for client + channelName API#467
zknill wants to merge 2 commits intoai-transport-featuresfrom
zak/ait-718/accept-realtime-client

Conversation

@zknill
Copy link
Copy Markdown

@zknill zknill commented May 6, 2026

Update the createAgentSession (AIT-ST1) and createClientSession (AIT-CT1) factory specs to reflect the new option shape: an Ably.Realtime client and a channelName instead of a pre-resolved Ably.RealtimeChannel. The session resolves the channel internally via client.channels.get(channelName).

Add sub-points AIT-ST1a and AIT-CT1a covering agent registration: on construction, both sessions must register the ai-transport-js identifier with the SDK version on the Realtime client's options.agents map for usage tracking. Registration is idempotent across sessions sharing a client. Specify that close() does not release the channel or close the client — the caller owns the client lifecycle.

Update the `createAgentSession` (AIT-ST1) and `createClientSession`
(AIT-CT1) factory specs to reflect the new option shape: an
`Ably.Realtime` client and a `channelName` instead of a pre-resolved
`Ably.RealtimeChannel`. The session resolves the channel internally
via `client.channels.get(channelName)`.

Add sub-points AIT-ST1a and AIT-CT1a covering agent registration:
on construction, both sessions must register the `ai-transport-js`
identifier with the SDK version on the Realtime client's
`options.agents` map for usage tracking. Registration is idempotent
across sessions sharing a client. Specify that `close()` does not
release the channel or close the client — the caller owns the
client lifecycle.
Replace the single agents-map sentence on AIT-ST1a / AIT-CT1a with
three sub-items modeled on chat spec CHA-IN1:

- 1a1: where the underlying Realtime SDK exposes a wrapper-SDK
  proxy (createWrapperSDKProxy, per CHA-IN1a), use it.
- 1a2: where it does not (current ably-js), inject options.agents
  AND pass params.agent on channels.get — what AIT-JS does today.
  Mirrors CHA-IN1e.
- 1a3: agent identifiers must be registered in
  ably-common/protocol/agents.json per RSC7d5.

Writing the requirement as a fallback chain keeps the spec forward-
compatible with the eventual ADR-117 wrapper-SDK proxy work in
ably-js without a future spec rewrite, and gives the upcoming
Swift/Kotlin AIT SDKs (which target ably-cocoa/ably-java where the
proxy already exists) the right primary path to reach for. The
top-level points also gain an ownership clause: the session owns
its channel, so callers must not resolve the same channel name
elsewhere with conflicting options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant