Repository navigation
.NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions #8775
Description
Parent issue
Sub-issue of #8125 (please link it as a child; I cannot add sub-issues). Siblings #8446 (Hyperlight, PR #8528) and #8445 (Python, merged in #8459) are separate. A fix for this issue should reference #8125 as partially addressed and must not close the parent.
Confirmed behavior
At upstream/main, dotnet/src/Microsoft.Agents.AI.LocalCodeAct/Internal/InstructionBuilder.cs::BuildExecuteCodeDescription emits each host AIFunction name and description but never reads JsonSchema. The model does not receive parameter names, requiredness, descriptions, enums, or nested shapes for tools registered on LocalCodeActProviderOptions.Tools.
Both LocalExecuteCodeFunction and LocalCodeActProvider use this shared builder, so both entry points are affected. This is the same defect as #8446 in a different package; the Python fix (#8459) covered both of its runtimes (Hyperlight and Monty) in one change, but the .NET child was scoped to Hyperlight only.
Reproduction
Register a tool with a required parameter, for example AIFunctionFactory.Create((string partNumber) => ..., "get_stock"), on LocalCodeActProviderOptions.Tools, then inspect new LocalExecuteCodeFunction(pythonPath, options).Description. The tool listing contains only the name and description. Generated code then fails at runtime with "The arguments dictionary is missing a value for the required parameter 'partNumber'".
Acceptance criteria
- Surface existing host-tool
JsonSchemain the model-facing execute-code description for both entry points, using the same rendering as .NET: include host-tool JsonSchema in Hyperlight execute_code descriptions #8528 so the two .NET packages stay consistent. - Add parameterized-host-tool regression coverage for the builder and both entry points; existing tests use zero-parameter tools and miss the defect.
- Preserve no-tool output, the code-only execute-code input schema, approval behavior, and file-mount instructions.
- Rendering format options (compact vs JSON, as Python has via
tool_description_format) are out of scope and tracked separately.
Status
I have an implementation with tests ready and will open a PR referencing this issue.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
[-].NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/-][+]Python: .NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/+][-]Python: .NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/-][+].NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/+]github-actions commentedon Sep 28, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
dotnet/src/Microsoft.Agents.AI.LocalCodeAct/Internal/InstructionBuilder.cs::BuildExecuteCodeDescriptionomitsAIFunction.JsonSchemawhen a registered host tool has parameters; bothLocalExecuteCodeFunctionandLocalCodeActProvideruse this output. Minimal repro: createget_stockfrom a delegate with requiredpartNumber, confirm itsJsonSchemacontains that name, then assert the builder-generated description contains it—the assertion fails.dotnet/tests/Microsoft.Agents.AI.LocalCodeAct.UnitTests/InstructionBuilderTests.cs