From 6a78bec7ef12a2309aed09ceb25fe9ff5b3c5b2e Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Tue, 14 Oct 2025 10:13:12 -0500 Subject: [PATCH] minor change --- .../Instructs/Services/InstructService.Execute.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs b/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs index 0e4484b7..e03e6352 100644 --- a/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs +++ b/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs @@ -238,6 +238,11 @@ public partial class InstructService Text = result?.Result?.ToString() }; + if (context?.Arguments != null) + { + context.Arguments.ForEach(x => state.SetState(x.Key, x.Value, source: StateSource.External)); + } + // After code execution foreach (var hook in hooks) { @@ -249,7 +254,7 @@ public partial class InstructService Model = string.Empty, TemplateName = scriptName, UserMessage = message.Content, - SystemInstruction = string.Empty, + SystemInstruction = context?.CodeScript, CompletionText = response.Text }); }