From 2eb0705ee0062cf3918c7fca304c1506b8b78911 Mon Sep 17 00:00:00 2001
From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Date: Mon, 27 Apr 2026 16:37:10 +0100
Subject: [PATCH] .NET: [Breaking] Support string[] arguments for file-based
skill scripts (#5475)
* support arguments of string[] shape for file-based skill scripts
* suppress breaking changes errors
* address feedback
* remove unnecessary usung directive
---
.../AgentSkills/SubprocessScriptRunner.cs | 44 ++--
.../CompatibilitySuppressions.xml | 140 +++++++++++++
.../Microsoft.Agents.AI/Skills/AgentSkill.cs | 3 +-
.../Skills/AgentSkillScript.cs | 7 +-
.../Skills/AgentSkillsProvider.cs | 7 +-
.../Skills/File/AgentFileSkill.cs | 17 +-
.../Skills/File/AgentFileSkillScript.cs | 24 ++-
.../Skills/File/AgentFileSkillScriptRunner.cs | 11 +-
.../AgentInlineSkillContentBuilder.cs | 74 ++++---
.../Programmatic/AgentInlineSkillScript.cs | 39 +++-
.../AgentSkills/AgentClassSkillTests.cs | 29 +--
.../AgentSkills/AgentFileSkillScriptTests.cs | 191 +++++++++++++++++-
.../AgentFileSkillsSourceScriptTests.cs | 28 ++-
.../AgentInlineSkillScriptTests.cs | 84 ++++++--
.../AgentSkills/AgentInlineSkillTests.cs | 10 +-
.../AgentSkills/AgentSkillsProviderTests.cs | 61 +++++-
.../AgentSkills/FileAgentSkillLoaderTests.cs | 2 +-
17 files changed, 650 insertions(+), 121 deletions(-)
diff --git a/dotnet/samples/02-agents/AgentSkills/SubprocessScriptRunner.cs b/dotnet/samples/02-agents/AgentSkills/SubprocessScriptRunner.cs
index e95bde61df..b2068c4c0b 100644
--- a/dotnet/samples/02-agents/AgentSkills/SubprocessScriptRunner.cs
+++ b/dotnet/samples/02-agents/AgentSkills/SubprocessScriptRunner.cs
@@ -5,16 +5,16 @@
// This is provided for demonstration purposes only.
using System.Diagnostics;
+using System.Text.Json;
using Microsoft.Agents.AI;
-using Microsoft.Extensions.AI;
///
/// Executes file-based skill scripts as local subprocesses.
///
///
-/// This runner uses the script's absolute path, converts the arguments
-/// to CLI flags, and returns captured output. It is intended for
-/// demonstration purposes only.
+/// This runner uses the script's absolute path and converts the arguments
+/// to CLI arguments. When the LLM sends a JSON array, each element is used
+/// as a positional argument. It is intended for demonstration purposes only.
///
internal static class SubprocessScriptRunner
{
@@ -24,7 +24,8 @@ internal static class SubprocessScriptRunner
public static async Task