From 674ca9c4e9eb10534be2c1b0bfdd94750393fb66 Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Mon, 2 Mar 2026 14:51:25 +0000 Subject: [PATCH] fix the issue --- .../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 @@ private async Task ReadSkillResourceAsync(string skillName, string resou { 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 async Task InvokingCoreAsync_CustomPromptTemplate_UsesCustomTemplateAsync // 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]