Skip to content

.NET: [Feature]: Agent Skill Script error details are not bubbled up to the agent #6304

Description

@tlecomte

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

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .Net

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions