.NET: include host-tool JsonSchema in Hyperlight execute_code descriptions - #8528
Open
leilei3167 wants to merge 2 commits into
Open
leilei3167 wants to merge 2 commits into
leilei3167 wants to merge 2 commits into
Conversation
…tions BuildExecuteCodeDescription listed host AIFunction names and descriptions but never read JsonSchema, so models missed parameter names, requiredness, descriptions, enums, and nested shapes. Append each tool's existing schema to the model-facing description and cover it with a parameterized regression.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Valid boolean schemas are omitted, and the input-schema preservation assertion examines the wrong function.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Surfaces .NET Hyperlight host-tool parameter schemas in model-facing execute_code descriptions.
Changes:
- Appends each host tool’s JSON schema to its description.
- Adds parameterized-tool regression coverage.
- Documents that schemas do not alter
execute_codeinputs.
File summaries
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI.Hyperlight/Internal/InstructionBuilder.cs |
Renders host-tool schemas. |
dotnet/tests/Microsoft.Agents.AI.Hyperlight.UnitTests/InstructionBuilderTests.cs |
Tests parameterized schema rendering. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Valid JSON Schema roots include boolean true/false; render those and stop accepting non-schema Array/String roots. Assert execute_code keeps its code-only input via HyperlightExecuteCodeFunction and the provider tool.
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.BuildExecuteCodeDescriptionlisted each hostAIFunctionname and description but never readJsonSchema. Models therefore did not receive host-tool parameter names, requiredness, descriptions, enums, or nested shapes through the execute_code description. Sibling Python work landed separately; this PR covers the .NET Hyperlight path only.Description & Review Guide
BuildExecuteCodeDescriptionnow appends each host tool's existingJsonSchemaunder aParameters (JSON Schema):line in the model-facing description (shared byHyperlightExecuteCodeFunctionandHyperlightCodeActProvider).JsonSchematext is the preferred rendering for .NET (Python added compact/json format options separately). Happy to adjust formatting if maintainers want a compact layout instead.Related Issue
Fixes #8446
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.Evidence
dotnet test …Hyperlight.UnitTests.csproj -c Release -f net10.0 -- --filter-class …InstructionBuilderTests→BuildExecuteCodeDescription_WithParameterizedTools_IncludesHostToolJsonSchemafailed (Assert.ContainsmissingParameters (JSON Schema)).