Skip to content

Comments

.Net: [.NET] Fix missing plugin name when converting function calls#13585

Open
OiPunk wants to merge 1 commit intomicrosoft:mainfrom
OiPunk:codex/semantic-kernel-13516-function-call-plugin-parse
Open

.Net: [.NET] Fix missing plugin name when converting function calls#13585
OiPunk wants to merge 1 commit intomicrosoft:mainfrom
OiPunk:codex/semantic-kernel-13516-function-call-plugin-parse

Conversation

@OiPunk
Copy link

@OiPunk OiPunk commented Feb 23, 2026

What

Fixes function-call conversion from Microsoft.Extensions.AI.ChatMessage so plugin/function names are preserved instead of collapsing into a single FunctionName string.

Why

ChatMessageExtensions.ToChatMessageContent(...) previously mapped FunctionCallContent.Name directly into FunctionCallContent.FunctionName and always left PluginName empty.

This breaks scenarios where providers return fully-qualified tool names (for example time_ReadFile), producing empty plugin names in user code and making invocation/diagnostics inconsistent.

Changes

  • Parse function names into (plugin, function) during conversion.
  • Support separators in this order:
    • .
    • -
    • _ (safe fallback only when there is a single underscore and the function segment is PascalCase).
  • Apply the same parsing when mapping FunctionResultContent from the matched function call.
  • Add regression tests in ChatMessageExtensionsTests for:
    • underscore-qualified names (issue scenario)
    • snake_case names that should remain unsplit
    • function result propagation of parsed plugin/function names

Verification

  • /Users/liweiguang/.dotnet/dotnet test dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj --filter ChatMessageExtensionsTests --nologo
  • /Users/liweiguang/.dotnet/dotnet test dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj --filter ChatMessageExtensionsTests --collect:"XPlat Code Coverage" --results-directory /tmp/sk-13516-coverage --nologo

Closes #13516

@OiPunk OiPunk requested a review from a team as a code owner February 23, 2026 14:58
@moonbox3 moonbox3 added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Feb 23, 2026
@github-actions github-actions bot changed the title [.NET] Fix missing plugin name when converting function calls .Net: [.NET] Fix missing plugin name when converting function calls Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: The function call plugin name printed is empty

2 participants