.NET: Enable function approval response content DevUI Extension#6778
Open
Kumima wants to merge 2 commits into
Open
.NET: Enable function approval response content DevUI Extension#6778Kumima wants to merge 2 commits into
Kumima wants to merge 2 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the .NET OpenAI Hosting “Responses” wire-model and conversion layer to recognize DevUI’s function_approval_response content discriminator and convert that payload into ToolApprovalResponseContent, addressing DevUI HITL approval failures (Fixes #6006).
Changes:
- Adds a new
ItemContentpolymorphic derived type for"function_approval_response"and its associated payload model. - Extends
ItemContentConverter.ToAIContentto convert the new wire type intoToolApprovalResponseContent+FunctionCallContent. - Introduces argument parsing for the approval response’s
function_call.argumentspayload.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/Models/ItemResource.cs | Adds the new ItemContentFunctionApprovalResponse wire-model type and discriminator registration. |
| dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/Converters/ItemContentConverter.cs | Converts function_approval_response items into ToolApprovalResponseContent and parses function-call arguments. |
Comment on lines
+447
to
+451
| /// <summary> | ||
| /// Represents function call information for approval response item. | ||
| /// </summary> | ||
| internal sealed class FunctionCall | ||
| { |
| [JsonDerivedType(typeof(ItemContentOutputText), "output_text")] | ||
| [JsonDerivedType(typeof(ItemContentOutputAudio), "output_audio")] | ||
| [JsonDerivedType(typeof(ItemContentRefusal), "refusal")] | ||
| [JsonDerivedType(typeof(ItemContentFunctionApprovalResponse), "function_approval_response")] |
Author
|
@rogerbarreto, could you take a look or assign reviewers? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
I can see there are some other MRs for this, and I did review those. Those are definitely AI generated without human tests. This is tested.
.NET DevUI relies on the default OpenAPI response endpoints. And it does not expect to accept the custom
MessageFunctionApprovalResponseContentfrom DevUI. This MR enables function approval response content DevUI Extension, so that the tool approval response will be handled.Concern:
This adds additional behavior into the OpenAPI response endpoints, which may make it not perfectly the same with the specification.
Verified:

Related Issue
Fixes #6006
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.