# Codex CLI with DeepSeek: why the sub-agent gets an empty task

The sub-agent gets an empty task because Codex wraps the task text in a message type that DeepSeek
ignores. The bug is in Codex. This post reflects the state on 21 November 2026 and I will update it
when [issue #36586](https://github.com/openai/codex/issues/36586) closes.

## Symptom

With the official DeepSeek one-command Codex setup you get a custom provider with
`wire_api = "responses"` and a `~/.codex/models.json` entry with `multi_agent_version: "v2"`.

`spawn_agent` returns success. The sub-agent starts, reads the workspace and replies that it has no
task, or greets. `followup_task` fails the same way. There is no error, so a writer/auditor pipeline
silently does nothing.

`fork_turns: "all"` can let a task through, but the child inherits the whole parent history and
continues the parent's narrative.

## Cause

In `codex-rs/core/src/tools/router.rs` (`ToolCall::direct_source()`), a provider that omits
`encrypted_function_args` is classified as an encrypted call. Codex then puts the task text, still
plaintext, inside an `encrypted_content` block of an `agent_message` item. That item type belongs to
the OpenAI Responses multi-agent beta, and DeepSeek ignores it. The child sees only the envelope
`Message Type: NEW_TASK ... Payload:` with an empty payload.

A rollout in the issue shows `"encrypted_content": "NONCE=Q7X9K2; reply with ..."` in readable text.
The block carries plain text. The fix belongs in Codex.

## Workarounds

The multi-agent version is fixed when a thread is created. After a catalog change, restart Codex
cold and open a new thread. Resumed threads keep v2.

1. Set `multi_agent_version: "v1"` on the DeepSeek entries in `~/.codex/models.json`. v1 sends the
   task as a plain user message, with the official binary. You lose `followup_task`,
   `send_message`, `list_agents` and `interrupt_agent`, so you cannot re-task an idle agent. One
   reporter also needed `supports_search_tool = false` to expose the v1 tools directly.
2. Install the patched CLI
   [codex-ds](https://github.com/CCanxue/codex-deepseek-subagent-fix). It keeps V2 and sends tasks
   as plain user messages to non-OpenAI providers. It installs as `~/.local/bin/codex-ds`
   next to `codex`. Releases are signed and the patch is public. It runs on Linux x86_64 only. The
   latest release is v0.147.0-deepseek.1 (14 August 2026) and upstream is at 0.171.0. Install it
   with `curl | bash` or build it yourself.
3. Run a separate `codex exec` per phase, for example writer, then auditor, from a shell script.
   Each phase gets a fresh context, with any provider and version. You get no sub-agent tools, you
   write the orchestration, and results pass through files.

Before you trust a pipeline in a new session, spawn a probe that must reply exactly `PROBE_OK`.

## Status

Issue #36586 has been open since August 2026, labeled bug, with no assignee. #45233 reports it
still broken on 0.154.0. A client-side fix exists as a
[`git am` patch](https://gist.github.com/Zoranner/5bdac054248e7dd7e9cc11d40d66114e) posted in the issue on
3 November 2026. It adds a provider capability `multi_agent_messages`, on by default only for the
OpenAI provider; custom providers can opt in. Without it, inter-agent payloads go as plain user
messages. It is not a PR: the repository only accepts PRs from collaborators. The fix has to be
merged by OpenAI. When #36586 closes, options 1 and 2 are no longer needed.
