Skip to content

.NET: add FunctionApprovalResponseItemParam to fix unrecognized type discriminator (fixes #6006)#6203

Open
hanhan761 wants to merge 1 commit into
microsoft:mainfrom
hanhan761:fix-6006-function-approval-response
Open

.NET: add FunctionApprovalResponseItemParam to fix unrecognized type discriminator (fixes #6006)#6203
hanhan761 wants to merge 1 commit into
microsoft:mainfrom
hanhan761:fix-6006-function-approval-response

Conversation

@hanhan761
Copy link
Copy Markdown

Summary

When DevUI sends a human-in-the-loop approval response via the Responses API, the payload includes an item with type "function_approval_response". The ItemParamConverter did not have a case for this type, causing a 400 error.

This fix adds:

  1. FunctionApprovalResponseItemParam class in ItemParam.cs — a new ItemParam subclass with request_id and approved properties
  2. Case in ItemParamConverter.cs — maps "function_approval_response" to the new type
  3. [JsonSerializable] attribute in OpenAIHostingJsonUtilities.cs — registers the type for source-generated JSON serialization

Issue

Fixes #6006

Verification

  • All three changes follow existing patterns used by similar item param types (e.g., MCPApprovalResponseItemParam)
  • The FunctionApprovalResponseItemParam mirrors the StreamingFunctionApprovalResponded event shape

Copilot AI review requested due to automatic review settings May 30, 2026 07:24
@moonbox3 moonbox3 added the .NET label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants