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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .NetpythonUsage: [Issues, PRs], Target: PythontriageUsage: [Issues], Target: All issues that still need to be triaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions