Skip to content

.NET: [Bug]: DEVUI Read unrecognized type discriminator id 'function_approval_response'. #6006

@wyarcdev

Description

@wyarcdev

Description

DevUI HITL approval fails for workflow-as-agent (function_approval_response not recognized)

Description

Using a workflow exposed as an agent (workflow.AsAIAgent) in DevUI, tool approval reaches Awaiting approval but fails when clicking Approve.
The approval response appears to send a function-approval payload (function_approval_response), and the hosting pipeline rejects it during JSON deserialization.

Repro (minimal)

  1. Register DevUI + OpenAI hosting endpoints.
  2. Register workflow as agent (AddAIAgent(... Agent = workflow.AsAIAgent(...))).
  3. Trigger a tool wrapped with ApprovalRequiredAIFunction.
  4. Click Approve in DevUI.

Expected
Approval response is accepted and execution resumes.

Actual
Request fails (400). Approval cannot resume execution.

Notes

• Tool invocation works.
• Pending approval state is reached.
• Failure occurs on approval response handling path.

Code Sample

Error Messages / Stack Traces

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Microsoft.AspNetCore.Http.BadHttpRequestException: Failed to read parameter "CreateResponse request" from the request body as JSON.
       ---> System.Text.Json.JsonException: Read unrecognized type discriminator id 'function_approval_response'. Path: $[0] | LineNumber: 0 | BytePositionInLine: 51.
         at System.Text.Json.ThrowHelper.ThrowJsonException(String message)
         at System.Text.Json.ThrowHelper.ThrowJsonException_UnrecognizedTypeDiscriminator(Object typeDiscriminator)
         at System.Text.Json.Serialization.Metadata.PolymorphicTypeResolver.TryGetDerivedJsonTypeInfo(Object typeDiscriminator, JsonTypeInfo& jsonTypeInfo)
         at System.Text.Json.Serialization.JsonConverter.ResolvePolymorphicConverter(J

Package Versions

• Microsoft.Agents.AI — 1.6.1 • Microsoft.Agents.AI.DevUI — 1.6.1-preview.260514.1 • Microsoft.Agents.AI.Hosting — 1.6.1-preview.260514.1 • Microsoft.Agents.AI.Hosting.OpenAI — 1.6.1-alpha.260514.1 • Microsoft.Agents.AI.Workflows — 1.6.1

.NET Version

NET 10

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions