Skip to content

[Bug][Codex App] Encrypted subagent MESSAGE payload is surfaced as gAAAA ciphertext after adapter_eof #3021

Description

@yxr1995-maker

Client or integration

Codex App with delegated subagent messaging.

Area

OpenAI Responses adapter, encrypted tool output recovery, and subagent message delivery.

Summary

After a native OpenAI Responses turn ended with:

stream disconnected before completion: Incomplete response returned, reason: adapter_eof

a later message from the same delegated subagent was delivered into the parent conversation as a raw encrypted-looking payload beginning with gAAAA..., instead of the plaintext subagent result or a structured decryption error.

The parent message envelope was rendered normally (Message Type, Task name, Sender, and Payload), but the entire payload body was ciphertext.

The ciphertext is intentionally not included in this report. It may contain encrypted task output and should be treated as sensitive even when it is not immediately readable.

Reproduction

Observed sequence:

  1. Run a parent Codex App task through a local OpenCodex proxy using the native OpenAI Responses adapter.
  2. Spawn a delegated subagent.
  3. The parent turn encounters adapter_eof before receiving a complete response.
  4. Interrupt or follow up with the subagent while recovering the task.
  5. The parent later receives a subagent MESSAGE event whose payload is a long gAAAA... ciphertext value rather than plaintext.

This was observed once in a live task. The asynchronous timing makes it non-deterministic, so the exact request, thread, account, and ciphertext values are omitted.

Expected behavior

  • Encrypted subagent or function output is decrypted only in the owning account/session context before delivery.
  • If the required decryption context is unavailable after retry, fail closed with a structured error and correlation-safe diagnostics.
  • Never forward the encrypted blob to the parent conversation or user-visible UI.
  • Preserve enough non-sensitive diagnostics to distinguish account/session mismatch, missing decryption state, and ordinary stream truncation.

Actual behavior

The parent task received a syntactically valid subagent message envelope containing raw ciphertext as its visible payload. The intended subagent output was lost.

Impact

  • User-visible task output is corrupted and cannot be acted on.
  • An internal encrypted artifact crosses into the user-visible message surface.
  • Retrying a long task can preserve the wrong account/session context and make recovery confusing.
  • Users may accidentally paste the ciphertext into logs, issues, or support channels.

Environment

OpenCodex: 2.34.0
Codex CLI: 0.151.0-alpha.7.1
Client: Codex App
Provider adapter: openai-responses
Auth mode: forward
Codex account mode: pool
Local proxy: 127.0.0.1:10100
OS: macOS 26.6.1 (Build 25G76) on Apple Silicon (arm64)

The local OpenCodex health endpoint remained healthy during diagnosis. The service log contained other 502/429 records, but did not contain the literal strings adapter_eof or the surfaced ciphertext, so this report does not claim a proven log-level correlation.

Related behavior

#919 covers mid-stream OpenAI socket resets affecting account affinity. This report is distinct: encrypted subagent output itself reached the parent UI after an incomplete stream.

Security and redaction

  • Ciphertext omitted.
  • Tokens, API keys, account identifiers, request IDs, thread IDs, and timestamps omitted.
  • No configuration file or raw log is attached.

Checks

  • Searched existing issues for adapter_eof, stream disconnected, and encrypted/decryption errors.
  • Removed secrets, ciphertext, account details, request credentials, and personal data.
  • Clearly marked the reproduction frequency and current evidence boundary.
  • Added operating system info

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions