invalid tool_call_id (HTTP 400) — Codex
Quick fix
If tool calls fail, use a native Responses-compatible GPT model; v3.16.5 can be rolled back to v3.16.4.
Symptom
Section titled “Symptom”{"error":{"message":"CC Switch local proxy failed while handling Codex endpoint /responses.
Provider: SenseNova; model: deepseek-v4-flash;
upstream_status: HTTP 400; cause: invalid tool_call_id",
"type":"invalid_request_error","code":"3","param":null,
"provider":"SenseNova","model":"deepseek-v4-flash",
"endpoint":"/responses","upstream_status":400}}Reported affected versions are v3.16.5 and v3.20.1. When Codex sends Responses requests through an upstream configured for Chat Completions, tool-call-related `tool_call_id` values may not be converted correctly. In v3.16.5, requests were reportedly still forwarded as Responses and the upstream returned `invalid tool_call_id`; the v3.20.1 variant showed `messages.2.tool_call_id 长度不足`.
A tested v3.20.1 comment stated that the upstream accepts non-empty ids of length 1–14, and the error actually corresponds to an empty-string id. Another comment said that when `function_call_output` lacks `call_id`, the conversion layer writes an empty id using `unwrap_or("")`, and PR #7374 has been proposed. The supplied material only shows that the PR was proposed; it provides no evidence of a merged or released fix. A separate HTTP 400 report for unsupported `vision` capability is a different error variant occurring in the same environment.
To continue tool calls immediately, switch to a native Responses-compatible GPT model that the reports verified as working.
If the issue began with v3.16.5, roll back to v3.16.4 as a temporary workaround described in the report.
For the v3.20.1 empty `tool_call_id` variant, follow the merge and release status of PR #7374; the original post provides no verifiable released fix.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 3 real issues
- Has this regression been tracked?
- The material only shows that PR #7374 was proposed; it provides no evidence that a fix was merged, released, or verified.
- Where is the Responses → Chat Completions request-body rewrite performed in v3.16.5?
- The original post asked maintainers to identify the relevant file or function, but the supplied discussion provides no confirmed answer.
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.