Repository navigation
feat(identitybroker): register each helper agent under its parent - #2913
Merged
Merged
Conversation
4 of 11 tasks
rdimitrov
force-pushed
the
feat/helper-registration
branch
from
November 20, 2026 11:43
21a3ad6 to
4bfb270
Compare
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]>
Subagents, parallel branches, and team members now get their own agent identity when the engine first publishes their session, before they run. Each registers in its root session's broker session with the agent that created it as parent, and a refused registration stops the helper. - D5: a child reports its parent's host session, and the broker refuses one that is not the parent's recorded host session. - Built-ins system/branch and system/member join system/explorer for helpers that run no named definition. - The credential holder moves a helper into its root's new broker session, after its parent, keeping its identity. - A helper whose root has no registered main agent, such as a member of a team with no source session, runs unregistered; its gateway calls fail closed. Part of #2555. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A team member registers with the definition its factory built it from, so an unknown agent type falls back to a generic member as before instead of being refused. - An API team keeps the class of a member's registration failure, so an unavailable broker stays retryable rather than an invalid argument. - A failed lookup of a helper's parent maps like a registration failure instead of always as retryable. - A helper lookup made after its root moved no longer joins an in-place renewal started before the move. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…reopens When a root's main agent registers into a reopened broker session at run entry, the tree's held helpers now register there too, parents first, keeping their identities, as the design's session end requires. Before, a helper moved only at its next gateway call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A resumed subagent is admitted again before it runs: a held credential is kept, and a helper with none registers as a new one does, so a helper whose registration failed or was lost is not resumed. - The child-store wrapper documents that it forwards only what the engine uses on a child store. - Parallel branches and Team-tool members are tested through the real wiring, not only subagents. - MoveHelpers visits helpers in a fixed order, so its test exercises the parent-first move every run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A resumed subagent runs the default explorer today, so the design no longer says it keeps its original definition; #2548 does that. - Members of a team created over the API register with the root's main agent as a stand-in creation parent; the design now says so. - system/member covers any member that runs no named definition. - The failure table, the walkthrough, and the test list cover the definition in check 7 and the parent host session (D5). - Shortcut notes for registration lineage records (#2541) and resuming a named subagent (#2548). Co-Authored-By: Claude Opus 5.5 <[email protected]>
ChrisJBurns
approved these changes
Nov 20, 2026
rdimitrov
force-pushed
the
feat/helper-create-seam
branch
from
November 20, 2026 13:38
2656979 to
3977775
Compare
rdimitrov
force-pushed
the
feat/helper-registration
branch
from
November 20, 2026 13:38
f37c302 to
fbe979f
Compare
Base automatically changed from
feat/helper-create-seam
to
feat/per-agent-registration
November 20, 2026 14:30
rdimitrov
merged commit Nov 20, 2026
44d2ea1
into
feat/per-agent-registration
77 of 115 checks passed
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]>
Merged
5 of 12 tasks
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
Helper agents (subagents, parallel branches, and team members) were never registered with the identity broker. Each one now gets its own agent identity when the engine first publishes its session, before it runs, registered under the agent that created it. A refused registration stops the helper.
internal/adapter/childstore, using feat(engine): let a child store admit each child it publishes #2912's seam).Service.RegisterHelperthen registers the helper in its root session's broker session. Its parent is the agent of its parent session, or the root's main agent for a member of a team created over the API, whose session records no parent. Registration runs after the child is persisted, as the design orders it.global/<name>definition, or by name only if the broker did not load one, in which case it is refused, as main sessions are in feat(identitybroker): give each agent its own identity, checked against loaded definitions #2883.system/explorer(an existing built-in), or the newsystem/branchandsystem/member.RegisterAgentRequest.ParentHostSessionID). The broker refuses a child whose reported value is not the parent's recorded host session. This ties each child to its parent and, through it, to the root host session that check 4 pins.ag_identities, as the design's "Session end" requires. A helper's credential lookup also moves it if that eager move failed.ChildSessionResumer. A helper whose credential is still held keeps it. One with none, as after a refused registration or a dropped credential, registers as a new one does, so a helper that cannot register is not resumed. A resumed subagent runs the default explorer, so it registers assystem/explorer, and the broker refuses that for an agent it recorded with another definition.identityBroker.enabledrow covers helpers.Helpers still have no broker MCP tools; #2914, next in the stack, adds them and closes #2555.
Issue relationship
Part of #2555. Part of #2554.
Type of change
Test plan
Baseline checks
task lint)task test:race), plus a focused race rerun of the touched packages after the review fixestask check:pr)task docs)task site:build)task api:check): engine unchanged in this PRContract tests (
internal/identitybroker/conformance)PERMISSION_DENIED, with a positive control.Other tests
MoveHelpersmoves every held helper, parents first, keeping their identities; it visits the grandchild first, so only the parent-first move passes. A grandchild's lookup after its root moved registers the child and then itself in the new broker session, keeping both identities. A helper that cannot move gets the error, not its old credential. A lookup made after the move doesn't join an in-place renewal started before it.RegisterHelper):ParentHostSessionID, broker session, owner, and incarnation.system/memberunder the root's main agent. A member registration with the broker down returnsErrIdentityBrokerUnavailable, not an invalid argument (checked by mutation).system/explorerunder the main agent; a refusal stops the resume.internal/app): a parallel branch and a Team-tool member each register under the main agent, assystem/branchandsystem/member. Passing the unwrapped store to the Parallel or Team tool fails these cases.internal/app): a default subagent and a subagent naming an--agents-dirdefinition each register under the main agent withsystem/explorerorglobal/code-reviewer, and the broker holds the registration. Removing the store wrapper fails this test.childstore: persists before admitting, reports the wrapped store's create support, and admits a resumed child without publishing it.Real use
I ran the real mecak8s locally with the broker on, OIDC sign-in, and HTTP sessions, driven by a mock model:
system/explorerunder the main agent and ran its tool calls.--agents-diragent registered asglobal/reviewerand ran.PERMISSION_DENIED) before it started. The parent got the error "durable child session could not be created: server: internal error: identity broker call failed".system/branchunder the main agent and ran.system/memberand its reviewer asglobal/reviewer, both under the main agent.POST /v1/teams, then run) registered its lead assystem/memberand its reviewer asglobal/reviewer. A member whose agent type does not exist fell back tosystem/memberinstead of blocking the team. All three were registered under the root session's main agent.Changes
internal/identitybroker/service.go,agents.goParentHostSessionIDand the D5 checkinternal/identitybroker/definition.go,adapter/definitionloader/loader.gosystem/branch,system/memberinternal/identitybroker/conformance/*internal/agentcredential/holder.gointernal/adapter/childstoreinternal/adapter/server/identity_broker_helpers.go,identity_broker.go,team.go,classification.goRegisterHelper, definition lookup, API team members, error classesinternal/app/helper_registrar.go,catalog.go,build.goRegisterHelper; member factory reports its definitiondocs/drafts/agent-identity/*user-docs/operating/mecak8s/identity-and-client-access.mdidentityBroker.enabledrow*_test.goAPI compatibility
--enable-identity-brokeron, these client-observable behaviors change:--agents-dirdirectories, or any named helper under an operatorharness_contextpolicy, no longer starts. The parent gets the existing creation-failure tool result. This is the same rule feat(identitybroker): give each agent its own identity, checked against loaded definitions #2883 applies to sessions.RunTeamwith the registration's class (unavailable or internal).--agents-dirdirectory.Special notes for reviewers
🤖 Generated with Claude Code