`codex exec`: multi_agent_v2 subagent results unusable — parent turn fails with "Encrypted function output content could not be decrypted or decoded"

Open 💬 3 comments Opened Jul 15, 2026 by blakegallagher1

Environment

  • codex-cli 0.144.4 (current latest release), npm install @openai/codex, darwin-arm64
  • macOS 27.0 (Apple Silicon)
  • Auth: ChatGPT (Pro plan), credentials in keyring (cli_auth_credentials_store = "keyring")
  • Model: gpt-5.6-sol, reasoning effort medium

Minimal configuration

[features.multi_agent_v2]
enabled = true
max_concurrent_threads_per_session = 1000

(Also reproduces with the field left at its default; and with features.enable_request_compression=false,<br>features.concurrent_reasoning_summaries=false, service_tier="auto" — none of these affect it.)

Minimal command

codex exec --skip-git-repo-check \
  "Using agents__spawn_agent, spawn exactly 1 subagent whose sole task is: reply with the word OK. \
   Wait for it with agents__wait_agent. Reply exactly: SPAWNED=<0|1> ERRORS=<none|exact text>."

Expected behavior

The child spawns, completes, and its output is returned to the parent; the parent reports SPAWNED=1 ERRORS=none.

Actual behavior

The child spawns and completes (spawn/limiter layer works; no AgentLimitReached even at 8 concurrent children),<br>but the parent cannot read the child's output. Every run ends with:

stream disconnected before completion: Encrypted function output content could not be decrypted or decoded.

RUST_LOG=error,codex_core=info places the failure in the parent turn while consuming inter-agent output:

INFO session_loop{thread_id=<uuid>}:submission_dispatch{otel.name="op.dispatch.inter_agent_communication" ...}
  :turn{... model=gpt-5.6-sol codex.turn.reasoning_effort=medium}: codex_core::session::turn:
  Turn error: stream disconnected before completion: Encrypted function output content could not be decrypted or decoded.

Reproduction rate

9/9 across: child counts 1 and 8; agent types default and a custom TOML role; root models<br>gpt-5.6-sol AND gpt-5.6-terra; fork_turns:"all" AND fork_turns:"none"; compression/summary<br>feature toggles on and off; service_tier priority and auto. 100% in codex exec (non-interactive).

Diagnostic narrowing (things ruled out)

  • Server-originated error: the string "could not be decrypted or decoded" does not exist in the<br>0.144.4 client binary — only the stream disconnected before completion: wrapper is client-side.<br>The server rejects the FunctionCallOutputBody.encrypted_content the client submits back.
  • Not model-gated at the root: identical failure with sol and terra roots.
  • Not forked-history contamination: fork_turns:"none" (clean child, no inherited encrypted<br>items) fails identically — so the encrypted payload at fault is the agents-tool function output<br>itself, not parent turns carried into the child (distinguishing this from openai/codex#25290's mechanism).
  • Children do spawn (rollout files are created per child under ~/.codex/sessions/), but in exec<br>runs the child tasks did not observably execute tools (a child instructed to write a file via shell<br>never created it), and agents__wait_agent sometimes returns "Wait completed" with no usable<br>output — so a file-relay workaround is NOT viable either. Headless multi-agent is fully unusable.

Interactive comparison

Interactive TUI/Desktop multi-agent flows on the same machine/config are configured and in routine use;<br>this failure has only been observed via codex exec. (Not re-verified interactively at exactly 0.144.4 —<br>maintainers may want to confirm whether the encrypted-output path differs between exec and interactive.)

Possibly related

  • openai/codex#26753 (closed) — MultiAgentV2 encrypted spawn_agent schema 400: "model not configured for encrypted tool use"
  • openai/codex#27205 (open) — functions.followup_task declares encrypted parameters but is not configured for encrypted tool use
  • openai/codex#17541 (open) — model switch mid-conversation: "encrypted content could not be decrypted"

Impact

Scripted/CI multi-agent orchestration through codex exec cannot retrieve any subagent results,<br>which blocks headless use of multi_agent_v2 entirely.

View original on GitHub ↗

3 Comments

ignatremizov · 1 month ago

Underlying issue might be https://github.com/openai/codex/issues/28058 - when they added encryption they didn't check all use of codex exec

Current workaround to get multi agent v1 for gpt-5.6-sol (which does not have this issue) is to override models.json catalog (make a copy from source) and change multi_agent_version to null (so it's by config) or v1 (so it's by model catalog json), and disabling deferred tools search.

romacv · 1 month ago

Confirming this on codex-cli 0.145.0-alpha.24, macOS 27.0 arm64, using interactive Codex collaboration. Four out of four custom reviewer spawns failed with the exact same error, including fork_turns: "none".

Although multi_agent_v2.enabled = false in my config, the current model catalog forces gpt-5.6-terra to multi_agent_version: "v2". The child is created, but the parent cannot read its result. Regular parent tool calls continue working.

This also confirms that disabling the config flag alone is not a sufficient workaround when the model catalog selects V2.

jkenter0528 · 1 month ago

Confirming this is also breaking interactive Codex Desktop on Windows, not only codex exec.

Environment

  • Codex App: 26.721.3996.0
  • codex-cli: 0.145.0 (the failure was already observed before this install while the prior 0.144.5 runtime was active)
  • Windows: Microsoft Windows NT 10.0.26200.0 x64
  • Root model: gpt-5.6-sol, reasoning medium
  • Native MultiAgentV2 with model-routed custom agents and fork_turns: "none"

Payload-level before/after from retained rollout JSONL

  • July 16, successful interactive v2 runs on the same root model: child-to-parent agent_message records contained input_text plus valid opaque encrypted_content beginning gAAAAA...; 0 malformed plaintext-in-encrypted blocks and 0 decrypt errors.
  • Current failing runs: child-to-parent records still label the second block encrypted_content, but the value is ordinary plaintext status/result prose rather than an encrypted token. Across the retained failing runs, 6 such malformed blocks were recorded and the parent produced the exact decrypt/decode error repeatedly.
  • Once a malformed record is stored, retrying the same Desktop thread fails immediately because the bad history is replayed.
  • Multiple fresh parent threads reproduced this after spawning three children, so this is not isolated thread corruption.

codex doctor reports healthy state databases, auth, WebSocket, and endpoint reachability. The current remote model catalog forces both Sol and Terra to multi_agent_version: "v2", so setting features.multi_agent_v2.enabled = false alone is insufficient.

The temporary local recovery was a startup-only model_catalog_json copy routing Sol/Terra to v1; effective routing verifies as v1 after the override. This restores work but removes the v2 workflow we rely on. The regression is a major blocker for visible, steerable Desktop subagents.