Repository navigation
feat(client)!: add v1 subagent sessions and the Opened marker to the client runtime - #184
Open
EugeneTheDev wants to merge 1 commit into
Conversation
This was referenced Dec 2, 2026
Merged
EugeneTheDev
force-pushed
the
eugenethedev/subagents-stack/09-client
branch
4 times, most recently
from
December 4, 2026 11:32
a0833de to
e1b04dc
Compare
EugeneTheDev
force-pushed
the
eugenethedev/subagents-stack/09-client
branch
2 times, most recently
from
December 4, 2026 16:28
36b0bbd to
68490ed
Compare
…lient runtime - Rewrite the v1 client's session tracking around `ClientSessionRegistry`: one snapshot holds every root and subagent holder, its opening state and the running opening calls. - A session's operations receive `SessionEvent.Opened` once its opening call has answered, so they can tell replayed updates from live ones. - Add `BaseClientSession`, `ClientSubagentSession` and `SubagentOperations` for subagents that the agent announces, with cancel and close. - Permission requests race through `PendingPermissions`, per root and per subagent. `session/close` acts on its own holder, and an agent request for an unknown session fails at once with `-32002`. - Move the session runtime into `client.internal`, deprecate three `ClientSession` members, and update the `acp` API dump. - Tests: registry, holder and `ClientSubagentSession` unit tests, the final `ElicitationSessionMapTest`, and the cross-transport `ClientUnknownSessionRequestTest`. AGENTS.md: the v1 client rules.
EugeneTheDev
force-pushed
the
eugenethedev/subagents-stack/09-client
branch
from
December 4, 2026 16:29
68490ed to
1b631da
Compare
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.
Part 9 of 11 of the stacked split of #158 (v1 subagents).
Contents
ClientSessionRegistry. One atomic snapshot holds:SessionEvent.Openedonce its opening call has answered, so replayed updates can betold apart from live ones.
BaseClientSession,ClientSubagentSessionandSubagentOperations, for the subagents that the agentannounces, with cancel and close;
ClientSessionnow extendsBaseClientSession;ClientSessionmembers are deprecated.PendingPermissions, per root and per subagent;ClientSession.close()acts on its own holder;-32002.client.internal, and theclientSessionfacade keeps its JVM name through@file:JvmName. TheacpAPI dump gets the client blocks.PendingPermissionsbullet;ClientSubagentSessionunit tests, the finalElicitationSessionMapTest, and theSTDIO and WebSocket
ClientUnknownSessionRequestTest.Breaking changes
Clientfails withIllegalStateException("Session … is already open or being opened"), now also for theClientOperationsFactoryoverloads ofloadSessionandresumeSession. Close the session before loading it again.SessionEvent.Opened(thenotify(SessionEvent)migration is in feat!: add v1 subagents to the agent runtime and deliver session events through ClientSessionOperations.notify #183). A successful opening delivers exactly oneOpened, carrying the opening call's answer. An opening that fails before its answer delivers none. After the answer, the call still fails if its caller is cancelled, ornotifythrows, while it deliversOpenedand the updates queued before the session took over; treat a failed opening call as a failed opening (later updates go toGlobalSessionUpdateHandler, and the session can be opened again).-32002instead of waiting.ClientSession.client,ClientSession.currentMode,ClientSession.configOptionsandClientSession.setConfigOption.Caveats
of the new state machine.
acp/src/commonMainis identical tod41c266.Stack
chore: add the multi-agent orchestration toolingbuild: move buildSrc to build-logic and check that internal packages hold no public APIdocs(samples): give each sample its own package, run task and READMErefactor: move MaybeUndefined to the model package and runtime internals to internal packagesfeat(protocol)!: order handler starts by arrival and add response hooksfeat(model): add the v1 subagent models and promote session/close to stablefix(client): make v2 close and delete idempotent and add PendingPermissionsfeat!: add v1 subagents to the agent runtime and deliver session events through ClientSessionOperations.notifyfeat(client)!: add v1 subagent sessions and the Opened marker to the client runtime← this PRtest(client): cover v1 client openings and subagents over the wire and across transportsdocs(samples): add a subagents sampleNext steps
master.master(git rebase --onto master <merged> <next>) and force-push it.