Repository navigation
feat(protocol)!: order handler starts by arrival and add response hooks - #180
Merged
Merged
Conversation
This was referenced Dec 2, 2026
Merged
EugeneTheDev
force-pushed
the
eugenethedev/subagents-stack/05-protocol
branch
3 times, most recently
from
December 4, 2026 11:30
34e2121 to
b572bfc
Compare
Base automatically changed from
eugenethedev/subagents-stack/04-moves
to
master
December 4, 2026 11:32
EugeneTheDev
force-pushed
the
eugenethedev/subagents-stack/05-protocol
branch
from
December 4, 2026 11:32
b572bfc to
152924f
Compare
slapoguzov
reviewed
Dec 4, 2026
slapoguzov
requested changes
Dec 4, 2026
- `Protocol` starts incoming handlers in arrival order and runs each until its first suspension before the next one starts. It adds the typed `sendRequest` with a response hook that runs in the read loop, and `newConnectionScope` for connection-scoped work. - `RequestOutcome` gains `onResponseQueued`, which runs once the transport has accepted the success response. It is no longer a data class and is `@UnstableApi`; the `acp` API dump changes accordingly. - `ClientNegotiator`: a cancelled negotiation makes later callers fail with an `IllegalStateException` instead of a rethrown `CancellationException`. - `SequenceToPaginatedResponseAdapter`: make its CAS lambda pure. - Tests: `ReadLoopOrderingTest` with its `ProtocolTestSupport` helper, and updates to `BatchProtocolTest`, `StdioTransportFlowTest` and `ClientNegotiatorTest`. - AGENTS.md: the `RequestOutcome` bullet and "Read-loop ordering and hooks".
EugeneTheDev
force-pushed
the
eugenethedev/subagents-stack/05-protocol
branch
from
December 4, 2026 15:33
152924f to
d6b3b74
Compare
EugeneTheDev
added a commit
that referenced
this pull request
Dec 4, 2026
EugeneTheDev
added a commit
that referenced
this pull request
Dec 4, 2026
slapoguzov
approved these changes
Dec 4, 2026
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 5 of 11 of the stacked split of #158 (v1 subagents).
Contents
Protocolstarts incoming notification and request handlers in arrival order on one thread. It runs each untilits first suspension before the next one starts.
ReadLoopOrderingTestcovers this.Protocol.sendRequest, with a response hook that runs in the read loop for a successresponse.
Protocol.newConnectionScope, for work that outlives a request.RequestOutcomegainsonResponseQueued, which runs once the transport has accepted the success response. Itis no longer a data class and is now
@UnstableApi, socopy,componentN,equalsandhashCodeleave theacpAPI dump.ClientNegotiator: when a negotiation is cancelled, later callers fail withIllegalStateExceptioninsteadof a rethrown
CancellationException.SequenceToPaginatedResponseAdapter's CAS lambda is now pure.RequestOutcomebullet and a new "Read-loop ordering and hooks" section.Breaking changes
RequestOutcomeis no longer a data class:copy,componentN,equals,hashCodeandtoStringare gone, and its constructor takes the newonResponseQueuedparameter (with a default), so compiled callers must be recompiled. It is now@UnstableApi, which asks for an opt-in with a warning.Caveats
newConnectionScopeandonResponseQueuedare first used in 08;Protocol.sendRequestand its response hook are first used in 09.session/updatesorting (09), "an opening undoes it, a close completes it" (09), and subagent collections andopenings (08 and 09).
Protocol: master's v1 and v2 runtimes now run on it.checkpasses.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 hooks← this PRfeat(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 runtimetest(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.