Description
AgentSkillsProvider provides a run_skill_script tool, whose implementation swallows exceptions and never returns the error details to the agent:
|
return $"Error: Failed to execute script '{scriptName}' from skill '{skillName}'."; |
This prevents the agent from self-correcting itself.
In Microsoft.Extensions.AI, the behavior is configurable with FunctionInvokingChatClient.IncludeDetailedErrors: https://github.com/dotnet/extensions/blob/d6451f303b4142f9e6b6706e901dc1e43d12933c/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs#L1269
It would be nice to have a similar configuration option in AgentSkillsProviderOptions, to rethrow the exception rather than swallowing it, so that FunctionInvokingChatClient.IncludeDetailedErrors can then be applied.
Code Sample
Throw an exception in ConvertUnits in the Agent_Step03_ClassBasedSkills sample program: https://github.com/microsoft/agent-framework/blob/90a3e5de47cf48dfdef25c00c49cf56e0c80df8e/dotnet/samples/02-agents/AgentSkills/Agent_Step03_ClassBasedSkills/Program.cs#L109
Language/SDK
.NET
Description
AgentSkillsProviderprovides arun_skill_scripttool, whose implementation swallows exceptions and never returns the error details to the agent:agent-framework/dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillsProvider.cs
Line 360 in 90a3e5d
This prevents the agent from self-correcting itself.
In Microsoft.Extensions.AI, the behavior is configurable with
FunctionInvokingChatClient.IncludeDetailedErrors: https://github.com/dotnet/extensions/blob/d6451f303b4142f9e6b6706e901dc1e43d12933c/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs#L1269It would be nice to have a similar configuration option in
AgentSkillsProviderOptions, to rethrow the exception rather than swallowing it, so thatFunctionInvokingChatClient.IncludeDetailedErrorscan then be applied.Code Sample
Throw an exception in ConvertUnits in the Agent_Step03_ClassBasedSkills sample program: https://github.com/microsoft/agent-framework/blob/90a3e5de47cf48dfdef25c00c49cf56e0c80df8e/dotnet/samples/02-agents/AgentSkills/Agent_Step03_ClassBasedSkills/Program.cs#L109Language/SDK
.NET