Invalid parameter: This model does not support assistant message prefill - Codex
Quick fix
Upgrade to CC Switch 4.0 or the latest version and retry. If it still fails, submit complete reproduction details and logs.
Symptom
Section titled “Symptom”Invalid parameter: ValidationException: This model does not support assistant message prefill.
The conversation must end with a user message.In CC Switch v3.16.1, Codex takeover uses local routing to convert and forward `/responses` requests to a custom OpenAI-compatible endpoint that uses the Chat Completions protocol. If the forwarded `messages` end with an `assistant` message and the upstream model does not support assistant message prefill, the upstream service returns HTTP 400.
The reporter suggested adding a `strip_assistant_prefill` rectifier to remove the trailing `assistant` message before forwarding or merge it into the preceding `user` message. However, the issue was closed after timing out without new reproduction details, not as a confirmed fix. The maintainer only stated that 4.0 substantially refactored the relevant functionality and recommended updating and retrying.
Update CC Switch to 4.0 or the latest version, then retest with the same Codex provider, Model Mapping, Local Routing, and Codex takeover configuration.
If the problem persists after updating, resubmit the CC Switch version, macOS information, complete reproduction steps, and relevant logs or screenshots.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.