microsoft / microsoft/agent-framework

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

Open
#6,006 1 comment 2 reactions 1 assignee View on GitHub

@rogerbarreto is already working on this.

Since Jun 16, 2026.

.NET bug devui reproduced
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

### 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

```markdown

```

### Error Messages / Stack Traces

```markdown
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_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.