Skip to content

.NET: Improve inline skill argument error guidance - #8118

Merged
SergeyMenshykh merged 1 commit into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-improve-skill-argument-error
Sep 7, 2026
Merged

.NET: Improve inline skill argument error guidance#8118
SergeyMenshykh merged 1 commit into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-improve-skill-argument-error

Conversation

@SergeyMenshykh

Copy link
Copy Markdown
Contributor

Motivation & Context

Local and smaller models may serialize inline skill arguments into a JSON string instead of emitting a JSON object. The resulting exception explains the type mismatch but does not point users to the supported custom argument marshaler, making the recovery path difficult to discover.

Description & Review Guide

  • What are the major changes? Extend the invalid inline skill argument exception with a hint to configure a custom argument marshaler, and assert that guidance in the existing unit test for string-wrapped arguments.
  • What is the impact of these changes? Users receiving unsupported argument formats get an actionable diagnostic without changing marshaling behavior or public APIs.
  • What do you want reviewers to focus on? Whether the exception guidance clearly identifies the existing customization point without implying unsupported automatic conversion.

Related Issue

Closes #7989

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Point users to the custom argument marshaler when a model supplies inline skill arguments in an unsupported JSON format.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 406e0b5c-da2c-40f2-9232-4ff2742aad2c
Copilot AI balanced review requested due to automatic review settings September 7, 2026 10:27
@agent-framework-automation agent-framework-automation Bot added the .NET Usage: [Issues, PRs], Target: .Net label Sep 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused diagnostic change is accurate and adequately tested.

Pull request overview

Improves diagnostics for unsupported inline skill argument formats.

Changes:

  • Adds guidance to configure a custom argument marshaler.
  • Verifies the guidance in the existing string-argument test.
File summaries
File Description
AgentInlineSkillScript.cs Extends the exception message.
SkillScriptArgumentMarshalerTests.cs Asserts the new guidance.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): b85d427eea49
Model: gpt-5.6-sol-fast

Overview

The PR preserves the strict default argument-marshaling contract while adding actionable guidance to the existing invalid-kind exception. Public skill- and class-level marshaler configuration already provides the suggested recovery path, and tests cover strict rejection, custom marshaling, and propagation across construction paths. No publishable Critical, High, or Medium concern was established.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Sep 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 7, 2026
@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Sep 7, 2026
Merged via the queue into microsoft:main with commit fdf7e80 Sep 7, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET: [Bug]: Agent Skill throws "System.InvalidOperationException"

5 participants