diff --git a/src/Infrastructure/BotSharp.Core/Agents/Hooks/BasicAgentHook.cs b/src/Infrastructure/BotSharp.Core/Agents/Hooks/BasicAgentHook.cs index 03e7bb68..64113c10 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Hooks/BasicAgentHook.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Hooks/BasicAgentHook.cs @@ -66,13 +66,7 @@ public class BasicAgentHook : AgentHookBase var innerUtilities = utilities!.Where(x => { var isVisible = !string.IsNullOrEmpty(x.Name) && !x.Disabled; - if (!isVisible) - { - return isVisible; - } - - isVisible = agentService.RenderUtility(agent, x); - return isVisible; + return isVisible && agentService.RenderUtility(agent, x); }).ToList(); var functionNames = innerUtilities.SelectMany(x => x.Functions) diff --git a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.Rendering.cs b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.Rendering.cs index 89979663..f160a211 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.Rendering.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.Rendering.cs @@ -1,6 +1,5 @@ using BotSharp.Abstraction.Loggers; using BotSharp.Abstraction.Templating; -using Microsoft.EntityFrameworkCore; using Newtonsoft.Json.Linq; namespace BotSharp.Core.Agents.Services;