Repository navigation
.NET: expose host-tool JsonSchema in LocalCodeAct - #8776
Open
Pasindu Madusha (epcm18) wants to merge 3 commits into
Open
Pasindu Madusha (epcm18) wants to merge 3 commits into
Pasindu Madusha (epcm18) wants to merge 3 commits into
Conversation
Pasindu Madusha (epcm18)
temporarily deployed
to
github-app-auth
September 26, 2026 09:33 — with
GitHub Actions
Inactive
Pasindu Madusha (epcm18)
had a problem deploying
to
github-app-auth
September 26, 2026 09:33 — with
GitHub Actions
Error
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new C# test file violates the repository’s required UTF-8 BOM encoding convention.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Exposes host-tool JSON schemas in .NET LocalCodeAct descriptions while preserving the code-only execution schema.
Changes:
- Renders parameter schemas and zero-parameter status.
- Adds regression tests for both entry points.
- Documents schema visibility and enum handling.
| File | Description |
|---|---|
Internal/InstructionBuilder.cs |
Adds host-tool schema rendering. |
README.md |
Documents parameter metadata exposure. |
InstructionBuilderTests.cs |
Tests schema rendering cases. |
LocalExecuteCodeFunctionTests.cs |
Tests standalone function behavior. |
LocalCodeActProviderTests.cs |
Tests provider-generated function behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Author
|
@microsoft-github-policy-service agree |
Pasindu Madusha (epcm18)
temporarily deployed
to
github-app-auth
September 26, 2026 09:47 — with
GitHub Actions
Inactive
Pasindu Madusha (epcm18)
temporarily deployed
to
github-app-auth
October 3, 2026 14:14 — with
GitHub Actions
Inactive
Author
|
Hi Eduard van Valkenburg (@eavanvalkenburg) , a gentle ping when you have a moment: this is the .NET counterpart of microsoft/agent-framework#8459. Would you be able to go through the changes and check whether they match? Could you also approve the workflow runs here and on microsoft/agent-framework#8528? Thanks! |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation & Context
InstructionBuilder.BuildExecuteCodeDescriptioninMicrosoft.Agents.AI.LocalCodeActlisted each hostAIFunctionname and description but never readJsonSchema, so models could not learn parameter names, requiredness, descriptions, enums, or nested shapes forcall_tool(...). This is the LocalCodeAct counterpart of #8446 / #8528. The Python fix (#8459) covered both of its runtimes; this PR brings the second .NET runtime in line.Description & Review Guide
BuildExecuteCodeDescriptionappends each host tool's existingJsonSchemaunderParameters (JSON Schema):when the schema describes properties, emitsParameters: none.for zero-argument tools, and stays silent for unconstrained schemas ({}or boolean roots). This is the same rendering and the same guards as .NET: include host-tool JsonSchema in Hyperlight execute_code descriptions #8528 so both .NET packages produce identical descriptions.InstructionBuilderTests; description and code-only input schema assertions for bothLocalExecuteCodeFunction(new test class) andLocalCodeActProvider.JsonStringEnumConverternote for enums.codeparameter. No-tool output, approval behavior, and file-mount instructions are unchanged.src/Sharedinjected source file as a follow-up once .NET: include host-tool JsonSchema in Hyperlight execute_code descriptions #8528 lands.compactvsjsonformat option like Python'stool_description_formatis deliberately out of scope; I can open a separate design issue for both packages if wanted.Related Issue
Fixes #8775
Partially addresses: #8446 #8125
Contribution Checklist
Evidence
BuildExecuteCodeDescription_WithToolParameters_IncludesParameterMetadatafails on main (no parameter metadata in the description).dotnet test --project tests/Microsoft.Agents.AI.LocalCodeAct.UnitTests/Microsoft.Agents.AI.LocalCodeAct.UnitTests.csproj -f net10.0→ 109/109 passed.