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]