missing field `call_id`: Codex automation HTTP 400
Quick fix
No verified published fix is available. Normalize orphaned output without call_id during proxy forwarding and retain cross-task message content.
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: Failed to deserialize the JSON body into the target type: input: missing field `call_id`These reports share orphaned `function_call_output` entries in Codex session history, with no usable `call_id` or no matching preceding `function_call`. Strict upstream validation rejects the whole request; because the entry is resent with the history, reporters observed persistent HTTP 400 after retries. `automation_update` is described as task metadata, with task instructions in a separate `user` message. Output from cross-task `send_message_to_thread` may be the only carrier of task text, so dropping it directly can lose instructions. Local tests mentioned in comments say request-time cleanup can restore affected sessions, but this is not a confirmed published fix.
#6697 also describes persistent session 400, but with a different trigger: an upstream without vision support drops image-only tool output during conversion, leaving unpaired `tool_calls`. This is not the same data shape as a missing `call_id`; use placeholder tool messages or pairing validation to preserve the response relationship. Comments on #7230 mention a proposed PR and conversion strategy, but the original posts remain open, so this cannot be treated as fixed.
The original posts do not provide a verified, published solution. Retain the affected session and proxy request logs, and follow the source discussions for proxy forwarding-layer handling of orphaned `function_call_output`.
For metadata output such as `automation_update` without `call_id`, the discussion suggests filtering during forwarding or locally rejecting empty or missing `call_id`; do not fabricate or reuse `call_id`.
For cross-task output such as `send_message_to_thread` and `create_thread`, do not only filter it. The discussion suggests converting only identified delegated content into a normal `user` message to retain the delivered text.
For image-only tool output when the upstream does not support vision, #6697 suggests sending a text placeholder tool message to avoid leaving unpaired `tool_calls`.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- #6697[Bug] Codex 纯图片 tool 输出在无视觉能力的上游被整条丢弃 → 孤儿 tool_calls 导致会话永久 400
- #6995[Bug] Codex 心跳自动化注入的 function_call_output 缺失 call_id,DeepSeek /responses 400 导致会话永久卡死
- #7074[Bug] Codex 自动化 automation_update 孤立 function_call_output 无 call_id 导致 DeepSeek 400
- #7230[Bug] v3.20.2:Codex 跨任务消息 send_message_to_thread 触发 HTTP 400,提示缺少 call_id/name
- Has anyone tried DeepSeek's official method for connecting Codex, and can it avoid this issue?
- A reply in the thread says it was tried independently, but the same error still occurred.
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.