maximum context length is 1048565 tokens. — Codex
Quick fix
减少 PDF 或消息输入量;DeepSeek 兼容接口不支持 PDF 时停止上传,并更新 CC Switch 后重试。
Symptom
Section titled “Symptom”CC Switch local proxy failed while handling Codex endpoint /responses.
Provider: DeepSeek;
model: deepseek-v4-flash;
upstream_status: HTTP 400;
cause: This model's maximum context length is 1048565 tokens.
However, you requested 1072032 tokens
(1072032 in the messages, 0 in the completion).
Please reduce the length of the messages or completion.Codex 经 CC Switch 调用 DeepSeek 的 deepseek-v4-flash 时,请求消息达到 1072032 tokens,超过模型声明的 1048565 tokens 上下文上限,因此上游返回 HTTP 400。Issue 没有证据表明 CC Switch 3.16.2 会自动对 PDF 内容进行 token 预算控制、截断或压缩。
评论指出 DeepSeek 的 Anthropic 兼容接口不支持 type="document" 和 type="container_upload",因而认为 PDF 输入不受支持;但另有用户表示同样的 DeepSeek 在 Claude Code 中可以处理 PDF,两者存在矛盾。该 issue 最终因超时而非确认修复关闭,维护者仅说明 4.0 已重构相关功能,建议更新后重试。
缩短 PDF 或当前消息内容,使请求 token 数低于 deepseek-v4-flash 返回的 1048565 tokens 上限。
如果通过 DeepSeek 的 Anthropic 兼容接口调用,请停止发送 PDF;该接口被报告不支持 type="document" 和 type="container_upload"。
将 CC Switch 更新到最新版本后重新测试;维护者表示 4.0 对相关功能进行了较大重构。
若更新后仍然失败,重新提交完整的 CC Switch 版本、系统、复现步骤以及相关日志或截图。
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 1 个真实 issue
- CC Switch 是否会对 Codex 上传的 PDF 内容进行 token 预算控制、截断或压缩?
- 该 issue 没有确认 CC Switch 3.16.2 会执行这些处理;实际请求以 1072032 tokens 发送到上游,并因超过 1048565 tokens 上限而失败。
- 这是 CC Switch 的预期限制,还是 Codex 与 DeepSeek V4 集成的问题?
- 线程没有得出确定结论。评论认为 DeepSeek 的 Anthropic 兼容接口不支持 PDF,但也有用户表示同样的 DeepSeek 在 Claude Code 中可以处理 PDF;issue 最终因超时关闭。
- 为什么切换 API 登录后原对话全部消失,但 project 仍然存在?
- 线程中有其他用户复现了这一现象,但没有给出原因或确认的修复方案。
- 更新 CC Switch 后仍有问题怎么办?
- 维护者建议补充 CC Switch 版本、系统、完整复现步骤以及相关日志或截图后重新打开 issue。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。