Skip to content

[dotnet-port-api] Align skill script detailed errors with .NET #381

Description

@github-actions

Summary

Ported the .NET AgentSkillsProvider script detailed-error option from upstream commit e049bb569179384f11eb8a1b41d8a987fa416203 (microsoft/agent-framework@e049bb5). Go skills now expose ContextProviderOptions.IncludeDetailedErrors; by default script runner failures propagate as tool errors so tool auto-calling can apply its existing detailed-error policy, while trusted callers can opt in to returning the script exception message directly to the model.

Updated the parity comparison doc to note detailed skill script errors on both SDKs.

Ported .NET PRs

Breaking Changes

Yes. Previously, run_skill_script swallowed script runner failures and returned a generic string result with no tool error. Now the default propagates the original script error to the caller, allowing the function-calling layer to decide whether to expose details. This aligns with .NET behavior and is acceptable for the beta Go SDK because it preserves safe generic model-facing errors through tool auto-calling while making failures observable to callers.

Tests and Examples

  • Added skills provider tests for default script error propagation and IncludeDetailedErrors opt-in behavior.
  • Ran go test ./agent/skills/....

Notes

Skipped broader recent .NET skill changes around default approval policy, resources/scripts prompt content, description attributes, and archive skills because they are larger or depend on broader content-surface alignment. The upstream head inspected was upstream-agent-framework/main at f1d838fc5e800ddc1dcad28b637c11bb8e2022ab.

Generated by .NET to Go API Porting Agent · 1.2K AIC · ⌖ 32.2 AIC · ⊞ 21.6K ·


Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch dotnet-port-api-skill-detailed-errors-20260628065214-80ea2f68941b2f64.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (176 of 176 lines)
From de132f81a520fdf2e66951a2f3f9dea1dcb9a1e7 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Sun, 28 Jun 2026 06:52:14 +0000
Subject: [PATCH] Align skill script detailed errors with .NET

Port the .NET AgentSkillsProvider IncludeDetailedErrors option for skill script execution. By default script runner failures now propagate as tool errors so auto-calling can apply its detailed-error policy; trusted callers can opt in to returning the script error message directly to the model.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 agent/skills/provider.go                 | 36 ++++++++++-----
 agent/skills/provider_test.go            | 57 ++++++++++++++++++++++++
 docs/dotnet-go-sdk-feature-comparison.md |  2 +-
 3 files changed, 84 insertions(+), 11 deletions(-)

diff --git a/agent/skills/provider.go b/agent/skills/provider.go
index 2ba0d4f21..41e4a6bca 100644
--- a/agent/skills/provider.go
+++ b/agent/skills/provider.go
@@ -65,6 +65,13 @@ type ContextProviderOptions struct {
 	// ScriptApproval marks the run_skill_script tool as requiring approval.
 	ScriptApproval bool
 
+	// IncludeDetailedErrors controls whether script execution error details are
+	// included in the error message returned to the model. The default is false:
+	// script errors are returned to the caller so tool auto-calling can apply its
+	// own detailed-error policy. Enable this only for trusted skills and scripts;
+	// raw error messages may disclose details or contain prompt-injection text.
+	IncludeDetailedErrors bool
+
 	// DisableCaching rebuilds instructions and tools for every invocation.
 	DisableCaching bool
 
@@ -386,7 +393,7 @@ func (p *providerState) buildTools(skills providedSkillSet) []tool.Tool {
 			Arguments  []string `json:"arguments,omitempty" jsonschema:"Positional CLI-style string arguments for the script, e.g. [\"--value\",\"26.2\",\"--factor\",\"1.60934\"]"`
 		},
 		) (any, error) {
-			retu
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions