From 7d5959f3878aa325d3a357a5691098b471aaa2c9 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Mon, 11 Mar 2024 11:03:42 -0500 Subject: [PATCH] OnRoutingInstructionRevised --- .../Routing/Handlers/RouteToAgentRoutingHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs b/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs index ea020fd3..5ff9894e 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs @@ -44,7 +44,7 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler var states = _services.GetRequiredService(); var goalAgent = states.GetState("user_goal_agent"); - if (!string.IsNullOrEmpty(goalAgent)) + if (!string.IsNullOrEmpty(goalAgent) && inst.OriginalAgent != goalAgent) { inst.OriginalAgent = goalAgent; // Emit hook