Repository navigation
feat(engine): let a child store admit each child it publishes - #2912
Merged
Merged
Conversation
This was referenced Nov 20, 2026
ChrisJBurns
approved these changes
Nov 20, 2026
Add port.ChildSessionCreator, an optional SessionStore capability. When the engine first publishes a subagent, parallel-branch, or team-member session, it calls CreateChild instead of Create, passing the definition the child runs. An error stops the child before its first turn, like a failed Create. Stores without the capability behave as before. mecak8s uses this to register each helper agent with the identity broker before it runs (#2555). Co-Authored-By: Claude Opus 5.5 <[email protected]>
A member's factory falls back to a generic member when the roster's agent type is unknown, so the agent type is not always what runs. MemberBuild.DefinitionName reports the definition the factory adopted, and the supervisor passes it to CreateChild instead of the agent type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A resumed subagent was never published again, so a host could not admit it: a child whose admission was refused, or whose admission was lost, could be resumed and run. port.ChildSessionResumer gives the host ResumeChild before a resumed subagent runs again; an error stops the resume. The child-store decorator rule is narrowed to what the engine uses on child stores, and the background refusal test now waits for the child to end before checking that its model was not called. Co-Authored-By: Claude Opus 5.5 <[email protected]>
rdimitrov
force-pushed
the
feat/helper-create-seam
branch
from
November 20, 2026 13:38
2656979 to
3977775
Compare
This was referenced Nov 20, 2026
rdimitrov
added a commit
that referenced
this pull request
Nov 20, 2026
#2912 and #2913 were squash-merged into the base. Their trees match the commits this branch was built on, so every conflict resolves to this branch's side and the merged tree is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
#2555 registers each helper agent (subagent, parallel branch, team member) with the identity broker before it runs. The host needs a synchronous point where it can do that, and refuse, for every kind of child, and it needs to know which definition the child runs. No such seam exists: engine events are notifications, and the child-store
Createthe engine already calls carries no definition. #2555 asks for an engine seam to land first, as its own PR.port.ChildSessionCreator: an optionalSessionStorecapability. When a child store implements it, the engine callsCreateChildinstead ofCreateto first publish a subagent, parallel-branch, or team-member session.port.ChildSessionInfo{DefinitionName}: the definition the child runs. For a subagent it is the call'sagentargument. For a team member it is the newagent.MemberBuild.DefinitionName, the definition the factory actually built the member from: the factory falls back to a generic member when the roster's agent type is unknown, so the roster entry is not always what runs. It is empty for a def-less child: the default explorer, a parallel branch, or a generic member.CreateChildstops the child before its first turn, exactly like a failedCreate, and the parent sees the same creation-failure result.port.ChildSessionResumer: an optional store capability the engine calls withResumeChildbefore a resumed subagent runs again. It is not a new publication; the host uses it to admit the resumed child, and an error stops the resume. Without it, a child whose admission was refused or lost could be resumed and run.SupportsSessionCreate,CreateChild, andResumeChild. The port doc anddocs/architecture/ports.mdnow say a decorator of such a store may forward just those, as long as it advertises nothing else.Issue relationship
Part of #2555.
Type of change
Test plan
Baseline checks
task lint)task test:race)task docs): no Markdown beyond the changelogtask site:build): not applicabletask api:check)task api:update+engine/CHANGELOG.mdTests (
engine/agent/child_session_creator_test.go)CreateChildexactly once with its kind, parent, and definition, and neverCreate. A member passes the factory's definition, which is empty when the factory fell back from the roster's agent type.CreateChilderror stops each kind before its model is called. The subagent and team tools return the refusal; the branch fails with it.ResumeChildonce with no definition, and does not publish the child again. A refused resume never calls the child's model. Disabling the call fails these cases.""for team members fails the team case.Changes
engine/port/store.goChildSessionCreator,ChildSessionResumer,ChildSessionInfodocs/architecture/ports.mdengine/agent/subagent.go,parallel.go,teamsupervisor.gocreateChildSessionwith the definition;MemberBuild.DefinitionNameengine/api/port.txt,agent.txt,engine/CHANGELOG.mdengine/agent/child_session_creator_test.goAPI compatibility
Special notes for reviewers
Depsfield or tool options. The four child-publication sites already receive their store through host-set options (WithSubagentStore,WithParallelStore,WithTeamToolStore,WithMemberStore), so the host wraps those stores and needs no new plumbing.CreateChildmust still follow theSessionCapabilitySupportrule. The doc comment says so.🤖 Generated with Claude Code