Support multiple active clients per session#261
Draft
connor4312 wants to merge 3 commits into
Draft
Conversation
Replace the single optional `SessionState.activeClient` with a required `activeClients` array keyed by `clientId`: rename `session/activeClientChanged` to `session/activeClientSet` (upsert), add `session/activeClientRemoved`, and key `session/activeClientToolsChanged` by `clientId`. Port the session reducer across all five clients (TS/Rust/Kotlin/Swift/Go), regenerate wire types, schema, and reference docs, refresh reducer fixtures, and update every CHANGELOG. Document the multi-active-client lifecycle and host-side removal/cancellation flow in the customizations guide, and sweep stale `session/toolCall*` references to `chat/toolCall*`. Refs #141 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The required activeClients field was missing from the test-only SessionState constructor, breaking compileTestKotlin. Verified with `./gradlew test` under a JDK 17 container. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With activeClientSet now an upsert keyed by clientId, a client updates its published tools by re-dispatching its full SessionActiveClient entry. The tools-only patch action was redundant — and asymmetric, since customizations on the same entry had no equivalent. Drop it, leaving the clean Set/Removed pair for the activeClients collection. Update all five client reducers, generators, version registry, fixtures, CHANGELOGs, and the customizations/actions guides. Verified TS, Rust, Go, Swift, and Kotlin (container) suites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves session active-client tracking from a single client to multiple, per #141.
Protocol changes
SessionState.activeClients(required array, keyed byclientId) replaces the single optionalSessionState.activeClient.session/activeClientChanged→session/activeClientSet(upsert semantics).session/activeClientRemovedto release one client byclientId.session/activeClientToolsChangednow carries aclientId.Also in this PR
session/toolCall*doc references tochat/toolCall*.Verification
TS (269 tests, reducers 100% branch), Rust, Go, and Swift suites pass; generator drift check clean. Kotlin verified by inspection (no local JDK) — CI runs its gradle check.
Refs #141