diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs index bb08fcb6..b0527605 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs @@ -243,12 +243,16 @@ public class RoutingContext : IRoutingContext public Stack GetAgentStack() { - return new Stack(_stack); + var copy = _stack.ToList(); + copy.Reverse(); + return new Stack(copy); } public void SetAgentStack(Stack stack) { - _stack = new Stack(stack); + var copy = stack.ToList(); + copy.Reverse(); + _stack = new Stack(copy); } public void ResetAgentStack() diff --git a/src/Plugins/BotSharp.Plugin.SqlDriver/Hooks/SqlUtilityHook.cs b/src/Plugins/BotSharp.Plugin.SqlDriver/Hooks/SqlUtilityHook.cs index 566ac319..1984ee98 100644 --- a/src/Plugins/BotSharp.Plugin.SqlDriver/Hooks/SqlUtilityHook.cs +++ b/src/Plugins/BotSharp.Plugin.SqlDriver/Hooks/SqlUtilityHook.cs @@ -25,8 +25,8 @@ public class SqlUtilityHook : IAgentUtilityHook new AgentUtility { Name = UtilityName.SqlExecutor, - Functions = new List { new(SQL_SELECT_FN), new(SQL_TABLE_DEFINITION_FN) }, - Templates = new List { new($"sql_executor.fn") } + Functions = [new(SQL_SELECT_FN), new(SQL_TABLE_DEFINITION_FN)], + Templates = [new($"sql_executor.fn")] } };