When multiple Active agents share the requested name, matches are ordered by NormalizeUUID(ID)
and checked in order, resolving to the first match that passes all checks and refusing with the
first viewable match's failure reason only when none passes.
At most one handoff per user turn per source is enforced naturally because a successful Handoff
ends the source agent's run.
Resolves and validates a handoff target agent in deterministic order:
NotFound— no Active agent with that name (trimmed, case-insensitive), orContextUserlacks'view'permission on it.Self— the target is the source agent (SourceAgentID).NotDiscoverable—!AIAgentPermissionHelper.IsDirectlyDiscoverable(target).NotAllowedHere—HostAllowedIDsis present and the target is not in it.NoRunPermission—AIAgentPermissionHelper.HasPermission(target.ID, ContextUser, 'run')is false or throws (fail closed).AlreadyInThisTurn— the target is already inHandoffChain(prevents ping-pong and longer cycles).HopLimit—HandoffChain.length + 1 > MAX_HANDOFF_HOPS.When multiple Active agents share the requested name, matches are ordered by
NormalizeUUID(ID)and checked in order, resolving to the first match that passes all checks and refusing with the first viewable match's failure reason only when none passes.At most one handoff per user turn per source is enforced naturally because a successful Handoff ends the source agent's run.