Skip to content

Codex Desktop automation + DeepSeek Responses: standalone automation_update output lacks call_id (HTTP 400) #41690

Open

Description

@tianguoyan

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-30860fab6506
  • 01a052c0-973a-7781-bd29-f906210589d4
  • 01a052d7-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:

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_id for standalone named function_call_output items 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_update tool 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 developer message when no call_id exists;
  • flattens the root oneOf tool schema;
  • reorders function_call_output immediately after its matching function_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

  1. added
    bug
    app
    app-server
    custom-model
    windows-os
    on Aug 30, 2026
  2. Ahmet-Dedeler commented on Aug 31, 2026

    @Ahmet-Dedeler

    Also reproducing on Azure (gpt-5.6-sol, wire_api = "responses"), app-server
    0.151.0-alpha.7.2 / Desktop 26.825.51511. Full forensics in #41799, but two points are
    worth adding here specifically.

    These are two independent bugs that happen to share a tool. This issue links the defect to
    the root-oneOf tool-schema reports (#37786, #30523, #30132), and I think that framing may
    send people down the wrong path. I already run a local proxy that normalizes the
    automation_update tool schema so Azure will accept it — and it changes nothing here. The
    schema bug lives in body.tools[]; this one lives in body.input[]. Fixing the first does not
    touch the second.

    The impact is larger than a failed automation run when target_thread_id is set. Your
    repro 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 the
    orphan 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_output items, exactly 4 without call_id, spaced at
    precisely 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 the
    same payload shape.

  3. xdfnet commented on Sep 1, 2026

    @xdfnet

    Another reproduction from a production setup — this time macOS + DeepSeek official Responses API.

    Environment

    • macOS 27.0 (26A5425a), Apple Silicon
    • Codex Desktop 26.825.51511 (build 7377), bundled app-server 0.151.0-alpha.7.2
    • model_provider = "deepseek", base_url = "https://api.deepseek.com", wire_api = "responses", model = "deepseek-v4-flash"

    Exact error text

    Failed to deserialize the JSON body into the target type: input: missing field `call_id` at line 1 column 139647
    

    Impact

    Request

  4. bjdx8j4zm5-source commented on Sep 12, 2026

    @bjdx8j4zm5-source

    Workaround (verified): deliver the trigger the way it was delivered before e56e4922eb

    Same 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
    e56e4922eb it arrives as a standalone function_call_output with no call_id. And as
    @njwangcn pointed out, populating call_id alone is not a fix either — there is no
    matching function_call to 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:

    # every function_call_output without call_id -> plain user message with the same text
    {"type": "function_call_output", "id": "fco_…", "name": "automation_update",
     "namespace": "codex_app", "output": "<heartbeat>…</heartbeat>"}
    # becomes
    {"type": "message", "role": "user",
     "content": [{"type": "input_text", "text": "<heartbeat>…</heartbeat>"}]}

    Everything else — tool calls, reasoning items, streaming — is forwarded unchanged.

    [model_providers.deepseek]
    base_url = "http://127.0.0.1:19100/"   # local shim -> api.deepseek.com
    wire_api = "responses"

    Verified end to end:

    test result
    request containing an orphan function_call_output, sent directly to api.deepseek.com 400 missing field 'call_id'
    identical request through the shim 200, 27 SSE events, clean response.completed
    real codex exec run with the shim as base_url 200, normal model reply
    GET /models and a non-streaming POST /responses 200

    Outcome: 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), realigns thread_history_projection_state, and backs everything up
    before 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_id with a matching function_call, or going back to
    user-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。

    所以不去"修正"这条记录,而是加一个本地透传代理,把它改回旧格式再发给服务商:

    # 每个缺 call_id 的 function_call_output -> 内容相同的普通 user 消息
    {"type": "function_call_output", "id": "fco_…", "name": "automation_update",
     "namespace": "codex_app", "output": "<heartbeat>…</heartbeat>"}
    # 变成
    {"type": "message", "role": "user",
     "content": [{"type": "input_text", "text": "<heartbeat>…</heartbeat>"}]}

    其余内容(工具调用、reasoning、流式响应)原样透传。

    [model_providers.deepseek]
    base_url = "http://127.0.0.1:19100/"   # 本地代理 -> api.deepseek.com
    wire_api = "responses"

    端到端验证:

    测试 结果
    含孤儿 function_call_output 的请求,直连 api.deepseek.com 400 missing field 'call_id'
    同一请求走代理 200,27 个 SSE 事件,正常 response.completed
    真实 codex exec 以代理为 base_url 200,模型正常回复
    GET /models 与非流式 POST /responses 200

    结果:自动化能真正跑起来(而不是在第一次触发就死掉),并且不会再写入坏记录,因此
    "会话永久损坏"这个失败模式消失。

    对于已经坏掉的会话,同一个仓库里有修复脚本:从 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 消息投递。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appapp-serverautomationsbugcustom-modelwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions