Skip to content

.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 JsonSchema in 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.

Activity

  1. added
    .NETUsage: [Issues, PRs], Target: .Net
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Sep 26, 2026
  2. changed the title [-].NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/-] [+]Python: .NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/+] on Sep 26, 2026
  3. changed the title [-]Python: .NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/-] [+].NET: LocalCodeAct host-tool parameter schemas missing from execute_code descriptions[/+] on Sep 26, 2026
  4. added
    reproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow
    on Sep 28, 2026
  5. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    🤖 Automated triage reproduction notes (agent-authored — trust but verify)

    Agent analysis

    Repro: dotnet/src/Microsoft.Agents.AI.LocalCodeAct/Internal/InstructionBuilder.cs::BuildExecuteCodeDescription omits AIFunction.JsonSchema when a registered host tool has parameters; both LocalExecuteCodeFunction and LocalCodeActProvider use this output. Minimal repro: create get_stock from a delegate with required partNumber, confirm its JsonSchema contains that name, then assert the builder-generated description contains it—the assertion fails.

    • Failing test: dotnet/tests/Microsoft.Agents.AI.LocalCodeAct.UnitTests/InstructionBuilderTests.cs
    • Files examined: dotnet/src/Microsoft.Agents.AI.LocalCodeAct/Internal/InstructionBuilder.cs, dotnet/src/Microsoft.Agents.AI.LocalCodeAct/LocalExecuteCodeFunction.cs, dotnet/src/Microsoft.Agents.AI.LocalCodeAct/LocalCodeActProvider.cs, dotnet/tests/Microsoft.Agents.AI.LocalCodeAct.UnitTests/InstructionBuilderTests.cs
    • Tests run: BuildExecuteCodeDescription_IncludesHostToolParameterSchema
  6. added
    skillsUsage: [Issues, PRs], Target: skills related features
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .NetpythonUsage: [Issues, PRs], Target: PythonreproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflowskillsUsage: [Issues, PRs], Target: skills related features

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions