Invalid parameter: This model does not support assistant message prefill - Codex
Quick fix
先升级到经过相关功能重构的 CC Switch 4.0 或最新版重试;若仍失败,提交完整复现信息和日志。
Symptom
Section titled “Symptom”Invalid parameter: ValidationException: This model does not support assistant message prefill.
The conversation must end with a user message.在 CC Switch v3.16.1 中,Codex 接管经本地路由把 `/responses` 请求转换并转发到使用 Chat Completions 协议的自定义 OpenAI-compatible endpoint。若转发后的 `messages` 以 `assistant` 消息结尾,而上游模型不支持 assistant message prefill,上游就会返回 HTTP 400。
报告者建议增加 `strip_assistant_prefill` 整流器,在转发前移除末尾的 `assistant` 消息,或将其合并到前一条 `user` 消息中。但该 issue 因长期没有新的复现信息而超时关闭,并非确认修复;维护者仅说明 4.0 对相关功能做了较大重构,建议更新后重试。
将 CC Switch 更新到 4.0 或当前最新版,然后使用相同的 Codex provider、Model Mapping、Local Routing 和 Codex takeover 配置重新测试。
如果更新后问题仍然存在,重新提交 CC Switch 版本、macOS 信息、完整复现步骤,以及相关日志或截图。
Affected Versions
Section titled “Affected Versions”ToolCodex
Version受影响版本:3.16.1;4.0 是否修复未确认
PlatformsmacOS
Source Issues
Section titled “Source Issues”本页汇总自 1 个真实 issue
(暂无 FAQ)
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。