Fix malformed Responses API input items for custom models#313502
Fix malformed Responses API input items for custom models#313502DrHazemAli wants to merge 5 commits intomicrosoft:mainfrom
Conversation
Added normalization functions to handle response input items, ensuring no empty or missing type fields.
|
Please consider that providers like DeepSeek need the I solved the issue by creating a proxy, but it would definitely better to support HTH |
|
Hi @raffaeler The current normalization logic only fixes empty or missing type fields and does not block or strip unknown or provider-specific fields, So fields like |
|
Треба щоб хтось з колонірував код тоді буде все вірно працювати в мене немає на це права |
|
Hi @DrHazemAli
I understand that. Take my comment as a suggestion. I believe that more and more people will try to use open reasoning models which need that. |
|
Тоді буде правильно все працювати |
|
Добре. Але там проблема не втому а в самому коді тому треба зробити клон |
|
Hi @raffaeler
Thanks for clarifying. |
|
неправильно зроблено фільтрування та переносиння коду тому є фатальною помилкою тому буде покарено |
|
тобто покарано |
Summary
This PR fixes a Responses API payload issue where custom model requests can include an
input[]item with an emptytype, causing the API to fail with:Invalid value: ''. param: input[1]Root cause
The Responses API requires every
input[]item to have a validtype.In some custom model flows, especially with Responses API based models such as GPT-5.4 Pro and similar reasoning models, a message-shaped item can be added to the payload with an empty or missing
type. The request reaches the API, but fails validation before the model can process it.This is a client-side payload serialization issue, not a deployment, authentication, or model availability issue.
Affected models
This can affect custom models that rely on the Responses API instead of the classic Chat Completions API, including GPT-5.4 Pro style deployments and similar reasoning/model-inference deployments, However Chat-completions-compatible models, such as Kimi K2.6 in this tested setup, are not affected by this specific payload shape issue.
Related issues
Changes
type.type: "message".Best,
Hazem