Skip to content

Python: .NET: [Bug]: Skill CLI Execution Failure: Parameters Forcibly Converted to Dictionary<string, object> Breaking Standard Command-Line Parsing #5355

@scfido

Description

@scfido

Describe the bug

In the .NET implementation of the Microsoft Agent Framework, the Skill execution module for external command-line (CLI) scripts has a critical parameter formatting bug. When invoking standard CLI commands/scripts (e.g., scripts/tool.py input.docx --output input.index), the framework automatically converts the native command-line argument list (string[]) into a Dictionary<string, object> type. This breaks all standard CLI parameter parsers and causes external scripts/programs to fail execution.

To Reproduce

  1. Create a Skill using the .NET Agent Framework to invoke an external CLI script (Python/.NET console app).
  2. Pass standard CLI arguments: input.docx --output input.index.
  3. Execute the Skill to run the external script.
  4. The script fails to parse arguments due to the invalid dictionary format.

Expected behavior

The Skill should preserve the original command-line argument format as a string array (string[]) and pass it directly to the external process. This ensures compatibility with standard parsers (e.g., argparse, .NET Main(string[] args)).

Actual behavior

The Skill layer forcibly serializes/transforms the input arguments into a Dictionary<string, object> (key-value pairs). Standard CLI tools cannot recognize this format, resulting in parsing errors, index out-of-range exceptions, or failed execution.

Root Cause

The .NET Skill parameter handling component enforces conversion of user-provided CLI arguments to Dictionary<string, object> instead of retaining the native string array format. This violates standard command-line interface specifications.

Impact

  • Framework: Microsoft Agent Framework (.NET)
  • Module: Skill / External CLI Script Execution
  • Scenario: All use cases calling standard CLI tools with positional arguments and named options (--output, etc.)

Additional Context

  • Expected Argument Format: ["input.docx", "--output", "input.index"] (string[])
  • Actual (Broken) Format: {"input": "input.docx", "--output": "input.index"} (Dictionary<string, object>)
  • Affected command example: scripts/tool.py input.docx --output input.index

Suggested Fix

Modify the .NET Skill parameter pipeline:

  1. Add native support for passing raw string[] command-line arguments to external processes.
  2. Remove the forced conversion to Dictionary<string, object> for CLI execution scenarios.
  3. Maintain full compatibility with standard POSIX-style CLI argument conventions.

Code Sample

Error Messages / Stack Traces

Package Versions

1.1.0

.NET Version

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions