Repository navigation
Description
Summary
With Codex Desktop 26.825.51511 (app-server 0.151.0-alpha.7.2) and a third-party
provider using wire_api = "responses" (DeepSeek), resuming an existing thread or
sending a message to it fails with:
Failed to deserialize the JSON body into the target type: input: missing field `call_id` at line 1 column ~1605392
This is the same root cause as #41690, but that report only covers the automation
path (codex_app__automation_update). Here it also reproduces during ordinary
thread resume and cross-thread send (e.g., delegating a task to another thread /
send_message_to_thread), so the impact is broader than automations.
Environment
- Windows
- Codex Desktop app build:
26.825.51511 - Embedded app-server / command runner:
0.151.0-alpha.7.2 - Model provider: DeepSeek (third-party) via a local relay
- Config:
model_provider = "openai-chat-completions"base_url = "http://127.0.0.1:19100/v1"wire_api = "responses"requires_openai_auth = truemodel = "deepseek-v4-flash-vision-exp"
Reproduction
- Use a third-party Responses provider (DeepSeek).
- Open a thread that has accumulated tool calls (
function_call/function_call_output). - Send a new message (or delegate a task to it).
- The turn fails with
missing field call_id.
Evidence
The session rollout records a response_item of type function_call_output that has
id, name, namespace, output, and internal_chat_message_metadata_passthrough
but no call_id:
{"type":"function_call_output","id":"...","name":"...","namespace":"codex_app","output":"...","internal_chat_message_metadata_passthrough":"..."}This item is written into the session at the moment the thread is resumed (triggered by
the new message). When the app-server assembles the request body for the Responses API,
this standalone output lacking call_id is rejected by the strict third-party
deserializer.
Regression note
This worked on 26.820.71523 (8/30) and started failing after the app updated to
26.825.51511 on 8/31, with the same DeepSeek Responses provider throughout. Both
#41690 and #41799 are also on 26.825.51511.
Requested behavior
- When injecting a standalone
function_call_output(no matching call in the immediate
turn), the app-server should either synthesize acall_idor normalize it into a
provider-accepted message before sending to third-party Responses providers. - Alternatively, expose a provider capability/feature flag so strict Responses providers
receive a compatible tool-output shape.
Related
- Codex Desktop automation + DeepSeek Responses: standalone automation_update output lacks call_id (HTTP 400) #41690 (automation + DeepSeek + missing
call_id) - Codex Desktop macOS: Azure gpt-5.6-sol automations fail because bootstrap output has no call_id #41799 (macOS + Azure + missing
call_id) - 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 (root
oneOftool schema forcodex_apptools)
Activity
github-actions commentedon Sep 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
EmilioEsposito commentedon Sep 4, 2026
Current stable reproduction (macOS, OpenRouter)
I reproduced this on the current installed Desktop bundle:
26.901.319530.153.126.5.1, arm64Disposable reproduction:
create_threadwith a trivial prompt.systemErrorbefore any assistant output.send_message_to_thread.The redacted child rollout contains these two app-server-authored items:
{"type":"function_call_output","id":"fco_...","name":"create_thread","namespace":"codex_app","output":"..."} {"type":"function_call_output","id":"fco_...","name":"send_message_to_thread","namespace":"codex_app","output":"..."}Neither item has
call_id. Each is immediately followed byinvalid_prompt: Invalid Responses API request; the provider validation detail includespath: ["call_id"]andexpected string, received undefined.This confirms the regression persists in stable
0.153.1and, in this environment, affects the first turn of an agent-created child as well as a subsequent cross-task send. No accumulated project/tool history is needed.The public Responses contract requires function outputs to include the matching
call_id: https://developers.openai.com/api/docs/guides/migrate-to-responses#incremental-rollout-checklistAt current
maincommita07158c7846e5cb6684216d779598e540998f295, the non-OpenAI compatibility branch still clears internal metadata and encrypted function arguments but does not normalize aFunctionCallOutputwhosecall_idisNone:codex/codex-rs/core/src/client.rs
Lines 927 to 986 in a07158c
This appears to be the same provider-boundary issue described in #42376.
suntaoathome commentedon Sep 10, 2026
Additional CLI
/btwreproduction and tested compatibility workaroundAdding a CLI reproduction and a locally tested patch to this existing cross-thread issue. This is also related to #42088 and #43944.
Environment: Linux x86_64, source-built Codex, a third-party provider configured with
wire_api = "responses". The same construction is present in upstream commita62e98d18c6550e3bea152ed1b89d1e931dca961; the patch below is based on that commit.Reproduction and cause
/btwthread.send_message_to_thread.function_call_outputwith nocall_id, and the affected provider rejects it before inference:This originates inside Codex, not from prompt contents or a proxy removing the field:
TurnStartParams.tool_output.call_id: None.call_idvalues. History normalization deliberately preserves this notification form.The public app-server reproduction requires only
turn/startwith an existingthreadId,input: [], and:{ "toolOutput": { "name": "send_message_to_thread", "namespace": "codex_tui", "output": "A background thread finished." } }Candidate compatibility approach
At the provider-request boundary, project each named unpaired notification into a synthetic
function_callimmediately followed by its matchingfunction_call_output. Keep the name/namespace on the call and preserve the output content. Derive stable IDs from the source item ID, with a positional fallback for older ID-less history.The attached patch applies this only in the existing non-OpenAI provider branch. It leaves native OpenAI behavior, already-paired tool outputs, and stored history unchanged. The synthetic call is request context only: it is not executed. It also avoids promoting tool content to user/developer authority.
This is a tested compatibility workaround for maintainers to evaluate, not a claim that every provider supports the same behavior. A provider capability may be a better long-term selection mechanism. Simply inserting a random
call_idwould neither establish a matching call nor preserve request identity across retries.Validation
completed. No private project data was used.just test -p codex-api: 183 passed, including new structured-content, stable-ID, duplicate ID-less notification, idempotence, and existing-call preservation tests.just test -p codex-app-server --test all -E 'test(tool_output_compatibility) or test(thread_inject_items_adds_raw_response_items)': 5 passed, covering compatible-provider delivery, unchanged OpenAI delivery, and legacy/paginated history injection.previous_response_id.Validation limits: the unmodified aggregate core test target at this base commit fails to compile because
core/tests/suite/hooks.rs:1673calls the now-three-argumentfork_threadAPI with five arguments. The 44 WebSocket tests were therefore run through a temporary standalone test entry point importing the existing WebSocket suite. No complete workspace test pass is claimed.just bazel-lock-updatewas attempted but blocked by a connection timeout fetching the pinned V8 source archive; the attached patch has no regenerated Bazel lockfile.Focused WebSocket verification entry point
Temporarily place the following in
codex-rs/core/tests/btw_transport_verification.rs, then runjust test -p codex-core --test btw_transport_verificationfromcodex-rs. The wrapper was removed after verification and is not part of the patch.Complete local patch with regression tests (10 files; based on a62e98d)
Private conversation content, credentials, provider addresses, local machine paths, and author email metadata have been omitted.
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 消息投递。