Thanks to visit codestin.com
Credit goes to github.com

Skip to content

.NET: fix: accept stringified inline skill arguments#6144

Closed
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/inline-skill-string-args-6020
Closed

.NET: fix: accept stringified inline skill arguments#6144
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/inline-skill-string-args-6020

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Fixes #6020.

Summary

  • accept inline skill arguments that arrive as a JSON string containing an object
  • keep non-object arguments rejected, so arrays/plain strings still fail fast
  • clone argument JsonElement values before invoking the delegate so parsed string-backed arguments survive beyond the temporary JsonDocument
  • add a regression test for stringified object arguments

To verify

  • dotnet run --project dotnet\tests\Microsoft.Agents.AI.UnitTests\Microsoft.Agents.AI.UnitTests.csproj --framework net10.0 -- --filter-class "Microsoft.Agents.AI.UnitTests.AgentSkills.AgentInlineSkillScriptTests"
  • dotnet build dotnet\src\Microsoft.Agents.AI\Microsoft.Agents.AI.csproj --no-restore
  • dotnet build dotnet\tests\Microsoft.Agents.AI.UnitTests\Microsoft.Agents.AI.UnitTests.csproj --no-restore
  • git diff --check

One initial test attempt ran concurrently with a build and hit a transient Windows/Defender lock on an obj DLL; the same test command passed when rerun serially.

Copilot AI review requested due to automatic review settings May 28, 2026 10:56
@moonbox3 moonbox3 added the .NET Usage: [Issues, PRs], Target: .Net label May 28, 2026
@github-actions github-actions Bot changed the title fix: accept stringified inline skill arguments .NET: fix: accept stringified inline skill arguments May 28, 2026
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Closing this duplicate version in favor of #6214, which is the current branch for the same #6020 fix and has the cleaner current validation coverage. Keeping one active PR for this topic.

@he-yufeng he-yufeng closed this Jun 1, 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

None yet

Development

Successfully merging this pull request may close these issues.

.NET: [Bug]: Arguments valueKind is String instead of Object when calling AgentInlineSkillScript via functionCall

2 participants