From 59eb471deefc0c8ec8916cb19708a3ed731cbb3f Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Tue, 27 May 2025 15:26:11 -0500 Subject: [PATCH] minor change --- .../BotSharp.Core/Agents/Hooks/BasicAgentHook.cs | 8 +------- .../Agents/Services/AgentService.Rendering.cs | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) 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;