Range of input length should be [1, 1048576] - Codex
Quick fix
升级 CC Switch 至 v3.19.0 以修复图片被当作 base64 文本转发导致的 token 膨胀问题,或避免在代理下使用 view_image。
Symptom
Section titled “Symptom”HTTP 400 InternalError.Algo.InvalidParameter: Range of input length should be [1, 1048576]当 Codex 使用 `wire_api = "responses"` 并通过 CC Switch 本地代理时,`view_image` 等工具调用产生的图片会被转换层当作纯文本字符串(base64)塞入请求。这会导致单张图片 token 膨胀数千倍,迅速撑爆上下文并触发 400 错误。
此外,国内模型(如 GLM、豆包)对 OpenAI 兼容接口的支持存在差异,也可能引发其他 400 错误变体:新版 Codex 发送的 `detail: "original"` 图片参数不被支持(仅支持 `low`/`high`/`xhigh`/`auto`),或者请求中携带了模型不支持的 `reasoning` 参数。
升级 CC Switch 至 v3.19.0 或更高版本。该版本修复了转换桥,将工具结果中的图片提取为原生图片格式发送,避免 base64 文本化。
若暂时无法升级,请避免在代理环境下使用 `view_image` 工具,可改用 `pdftotext` 或 `pdfplumber` 等工具直接提取文本。
若遇到 `reasoning is not supported` 报错,请在配置中移除 `model_reasoning_effort` 选项。
若遇到 `invalid value: 'original'` 报错,目前需等待官方适配,或使用本地代理将 `detail: "original"` 改写为 `auto` 临时绕过。
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 3 个真实 issue
- 为什么升级后仍然报错 `reasoning is not supported`?
- 这是因为模型本身不支持 reasoning 参数,请在配置中移除 `model_reasoning_effort` 字段。
- 豆包或 GLM 报错 `invalid value: 'original'` 怎么解决?
- 新版 Codex 默认发送 `detail: "original"`,但部分国内模型不支持。目前可通过本地代理将 `detail: "original"` 改写为 `auto` 临时绕过,或等待 CC Switch 后续版本适配。
- 升级 CC Switch 后图片处理恢复正常了吗?
- 是的,v3.19.0 已将所有转换桥的处理方式改为提取图片并以原生格式发送,工具消息仅保留占位标记,解决了 token 膨胀问题。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。