Repository navigation
Description
Codex Desktop automation + DeepSeek Responses: standalone automation_update output lacks call_id (HTTP 400)
Summary
Codex Desktop automations configured with a third-party provider using the DeepSeek Responses API fail immediately on the first model request when the app-server injects a standalone function_call_output for codex_app__automation_update.
The injected item has id, name, namespace, and output, but no call_id. DeepSeek's /responses deserializer rejects the request with:
Failed to deserialize the JSON body into the target type:
input: missing field `call_id` at line 1 column 81274
The same request works with an OpenAI model because the OpenAI Responses endpoint accepts this named standalone output form, but strict third-party implementations may require a call_id.
Environment
- Windows
- Codex Desktop app build:
26.825.51511 - Embedded app-server / command runner:
0.151.0-alpha.7.2 - Model provider: DeepSeek official Responses API
- Config:
model_provider = "deepseek"base_url = "https://api.deepseek.com/"wire_api = "responses"model = "deepseek-v4-flash-vision-exp"
Evidence
Failures happen in the first turn of a cron automation with the name openviking 去旧上传续跑.
Session rollouts contain:
{
"type": "function_call_output",
"id": "fco_01a052c0-99ea-7633-b588-3c2651e9b332",
"name": "automation_update",
"namespace": "codex_app",
"output": "Automation: openviking 去旧上传续跑\nAutomation ID: openviking\n..."
}No call_id is present.
Failed session IDs:
01a052bf-96a8-7931-b67a-30860fab650601a052c0-973a-7781-bd29-f906210589d401a052d7-c75e-7440-a514-6c2d7eb67084
task_complete records:
Failed to deserialize the JSON body into the target type:
input: missing field `call_id` at line 1 column 81274
Minimal reproduction
Send a request to https://api.deepseek.com/responses with a function_call_output item that has no call_id:
{
"model": "deepseek-v4-flash-vision-exp",
"input": [
{
"type": "function_call_output",
"id": "fco_orphan",
"name": "automation_update",
"namespace": "codex_app",
"output": "test result"
}
]
}DeepSeek returns:
400
missing field `call_id`
Related issue
This is related to the root-oneOf tool schema problem for codex_app__automation_update, reported in:
- Codex Desktop: automation_update schema (root oneOf, type null) 400s on strict providers like DeepSeek (Responses API) #37786
- Codex Desktop custom provider app/dynamic tools end turns without function_call after automation_update-related prompts #30523
The schema issue can also fail independently on DeepSeek:
Invalid schema for function 'codex_app__automation_update':
schema must be a JSON Schema of 'type: "object"', got 'type: null'.
Expected behavior
- App-server should either synthesize a
call_idfor standalone namedfunction_call_outputitems before sending them to third-party Responses providers, or normalize them into a message item that the provider accepts. - Alternatively, expose a provider capability/feature flag so strict Responses providers receive compatible tool output shape.
- The
automation_updatetool schema should be emitted with a valid object root for third-party providers.
Workaround verified locally
A local reverse proxy that listens on 127.0.0.1 normalizes the request before forwarding to DeepSeek:
- converts the standalone output into a
developermessage when nocall_idexists; - flattens the root
oneOftool schema; - reorders
function_call_outputimmediately after its matchingfunction_call.
After the workaround, a real Codex Desktop automation run completed without an error and produced no repeated uploads.
Note
This report intentionally contains no API key or other credentials.
Activity
Ahmet-Dedeler commentedon Aug 31, 2026
Also reproducing on Azure (
gpt-5.6-sol,wire_api = "responses"), app-server0.151.0-alpha.7.2/ Desktop26.825.51511. Full forensics in #41799, but two points areworth adding here specifically.
These are two independent bugs that happen to share a tool. This issue links the defect to
the root-
oneOftool-schema reports (#37786, #30523, #30132), and I think that framing maysend people down the wrong path. I already run a local proxy that normalizes the
automation_updatetool schema so Azure will accept it — and it changes nothing here. Theschema bug lives in
body.tools[]; this one lives inbody.input[]. Fixing the first does nottouch the second.
The impact is larger than a failed automation run when
target_thread_idis set. Yourrepro and #41799's both show a fresh automation thread dying on its own first turn. My
automation is a
kind = "heartbeat"aimed at an existing long-running thread, and there theorphan gets persisted into that thread's rollout. Since Codex replays full history every
request, the thread is bricked permanently from the first bad tick — my own typed message hit
the same 400 forty minutes later, and every subsequent tick appended another orphan. In one
54,172-line rollout: 9,184
function_call_outputitems, exactly 4 withoutcall_id, spaced atprecisely the 15-minute automation interval.
Your minimal repro reproduces the API rejection exactly. Confirming it is not DeepSeek-specific:
Azure returns
Invalid Value: 'input.call_id'. Function call output requires call_id.for thesame payload shape.
xdfnet commentedon Sep 1, 2026
Another reproduction from a production setup — this time macOS + DeepSeek official Responses API.
Environment
26.825.51511(build 7377), bundled app-server0.151.0-alpha.7.2model_provider = "deepseek",base_url = "https://api.deepseek.com",wire_api = "responses",model = "deepseek-v4-flash"Exact error text
Impact
function_call_output(name=automation_update,namespace=codex_app) withoutcall_id, which strict/responsesproviders reject.Request
call_id).function_call_outputitems (the heartbeat failure mode in Codex Desktop macOS: Azure gpt-5.6-sol automations fail because bootstrap output has no call_id #41799), a way to purge them would also help — otherwise those threads are permanently bricked and must be rebuilt.bjdx8j4zm5-source commentedon Sep 12, 2026
Workaround (verified): deliver the trigger the way it was delivered before
e56e4922ebSame setup as reported here (Windows, Codex Desktop,
wire_api = "responses", DeepSeek).We hit both halves of the failure: the automation never completed a single run, and the
target thread became permanently unusable — every later user message returned the same
HTTP 400.
As @argszero traced above, the trigger used to arrive as a user message; since
e56e4922ebit arrives as a standalonefunction_call_outputwith nocall_id. And as@njwangcn pointed out, populating
call_idalone is not a fix either — there is nomatching
function_callto pair it with.So rather than trying to make the item valid, add a local passthrough proxy that rewrites
it back into the old form before it reaches the provider:
Everything else — tool calls, reasoning items, streaming — is forwarded unchanged.
Verified end to end:
function_call_output, sent directly toapi.deepseek.commissing field 'call_id'response.completedcodex execrun with the shim asbase_urlGET /modelsand a non-streamingPOST /responsesOutcome: the automation actually runs instead of dying on its first trigger, and no
malformed item is ever persisted — so the "permanently bricked thread" failure mode
disappears.
For threads that are already bricked, the same repo ships a repair script that removes
the orphan outputs from both the rollout JSONL and
thread_history_1.sqlite(
thread_items), realignsthread_history_projection_state, and backs everything upbefore touching it (dry-run by default). Restart Codex afterwards.
Code + write-up: https://github.com/bjdx8j4zm5-source/codex-strict-responses-fix
Caveat: this is a client-side workaround, not an app-server fix. The proper fix is either
attaching a real
call_idwith a matchingfunction_call, or going back touser-message delivery for injected triggers.
中文版
同样的环境(Windows + Codex 桌面版 +
wire_api = "responses"+ DeepSeek)。我们遇到了这个问题的两半:自动化一次都没成功运行过,而且目标会话被永久搞坏——之后每条消息都返回同样的
HTTP 400。
正如 @argszero 上面定位的:触发内容以前是以 user 消息下发的;
e56e4922eb之后改成独立的
function_call_output,且不带call_id。而 @njwangcn 说得对:只补call_id也不行——它没有配对的
function_call。所以不去"修正"这条记录,而是加一个本地透传代理,把它改回旧格式再发给服务商:
其余内容(工具调用、reasoning、流式响应)原样透传。
端到端验证:
function_call_output的请求,直连api.deepseek.commissing field 'call_id'response.completedcodex exec以代理为base_urlGET /models与非流式POST /responses结果:自动化能真正跑起来(而不是在第一次触发就死掉),并且不会再写入坏记录,因此
"会话永久损坏"这个失败模式消失。
对于已经坏掉的会话,同一个仓库里有修复脚本:从 rollout JSONL 和
thread_history_1.sqlite(thread_items)里删除孤儿输出、校正thread_history_projection_state偏移,改动前自动备份(默认 dry-run),修完重启Codex 即可。
代码与说明:https://github.com/bjdx8j4zm5-source/codex-strict-responses-fix
说明:这是客户端绕过方案,不是 app-server 的修复。官方正确修法是:补上真实的
call_id并配对
function_call,或让注入的触发内容改回 user 消息投递。