CC Switch local proxy failed while handling Codex endpoint /responses. Provider:...
错误信息
CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DMXAPI; model: gpt-5.6-terra-cdx; upstream_status: HTTP 400; cause: Invalid 'input[4].name': empty string. Expected a string with minimum length 1, but got an empty string instead. (request id: 20260723210005333532890yge8kxdF)
AI 解决方案
🔍 错误分析
1. 🌐 错误翻译
原文:CC Switch local proxy failed while handling Codex endpoint /responses. Provider: DMXAPI; model: gpt-5.6-terra-cdx; upstream_status: HTTP 400; cause: Invalid 'input[4].name': empty string. Expected a string with minimum length 1, but got an empty string instead. (request id: 20260723210005333532890yge8kxdF)
译文:在处理 Codex 端点 /responses 时,CC Switch 本地代理失败。服务提供商:DMXAPI;模型:gpt-5.6-terra-cdx;上游状态:HTTP 400;原因:无效的 'input[4].name':空字符串。预期字符串最小长度为1,但实际获取到的是空字符串。
2. 🎯 原因分析
根本原因:向
gpt-5.6-terra-cdx 模型发送的请求中,input[4].name 字段的值为空字符串,违反了该字段的最小长度验证规则。错误位置:请求数据中索引为4的输入项的 name 字段。
上下文:该错误发生在请求经过本地代理转发到DMXAPI的Codex端点时,服务器返回了400状态码,明确指出输入数据格式不符合要求。
3. 💡 解决方案
检查并修复发送的请求数据,确保
input 数组中索引为4的元素的 name 属性不为空字符串。修复示例:
// 错误代码示例
const invalidRequest = {
input: [
{ name: "item1" },
{ name: "item2" },
{ name: "item3" },
{ name: "item4" },
{ name: "" } // 错误:此处为空字符串
]
};
// 修复后的代码
const validRequest = {
input: [
{ name: "item1" },
{ name: "item2" },
{ name: "item3" },
{ name: "item4" },
{ name: "item5" } // 修复:确保name字段不为空
]
};