From 8a18f39b367c21908e0f55c43a891490df088ec6 Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:48:10 +0000 Subject: [PATCH] fix the issue (#4388) --- .../src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs | 3 ++- .../AgentSkills/FileAgentSkillsProviderTests.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs b/dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs index 847bf36a52..ad1ef752ee 100644 --- a/dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs +++ b/dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs @@ -174,7 +174,8 @@ public sealed partial class FileAgentSkillsProvider : AIContextProvider { try { - promptTemplate = string.Format(optionsInstructions, string.Empty); + _ = string.Format(optionsInstructions, string.Empty); + promptTemplate = optionsInstructions; } catch (FormatException ex) { diff --git a/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillsProviderTests.cs b/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillsProviderTests.cs index 6bfaf1b546..92dc5a5418 100644 --- a/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillsProviderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillsProviderTests.cs @@ -108,6 +108,8 @@ public sealed class FileAgentSkillsProviderTests : IDisposable // Assert Assert.NotNull(result.Instructions); Assert.StartsWith("Custom template:", result.Instructions); + Assert.Contains("custom-prompt-skill", result.Instructions); + Assert.Contains("Custom prompt", result.Instructions); } [Fact]