From 0b31cc209eb2e679df246dcd772a38f8424026ab Mon Sep 17 00:00:00 2001 From: Sakurasan <26715255+Sakurasan@users.noreply.github.com> Date: Thu, 27 Aug 2026 09:57:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20chat=E2=86=92responses=20=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=20input=20=E5=A7=8B=E7=BB=88=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 单条消息时原逻辑把 input 塌缩成单个对象,火山方舟等上游只接受 []*InputItem 数组,直接 400(Mismatch type)。chat/messages 经 vole 渠道转换因此全挂。改为恒为数组,三种协议全矩阵实测恢复。 --- server/internal/proxy/convert/json_responses.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/internal/proxy/convert/json_responses.go b/server/internal/proxy/convert/json_responses.go index 2c12c87..abaf567 100644 --- a/server/internal/proxy/convert/json_responses.go +++ b/server/internal/proxy/convert/json_responses.go @@ -240,11 +240,9 @@ func chatToResponsesReq(body []byte) ([]byte, error) { if len(system) > 0 { out["instructions"] = strings.Join(system, "\n") } - if len(input) == 1 { - out["input"] = input[0] // 单条消息项 - } else { - out["input"] = input - } + // input 必须是数组:部分上游(如火山方舟)只接受 []*InputItem, + // 单对象会被拒(400 Mismatch type)。 + out["input"] = input if len(req.Tools) > 0 { tools := make([]any, 0, len(req.Tools))