Skip to content

V2 cross-provider sub-agent loses NEW_TASK body in encrypted_content #92

Description

@webmastertorch

Summary

With multiAgentMode: "v2", a Codex parent using the native gpt-5.6-sol model can successfully spawn a child with the hidden model override set to xai/grok-4.5, but the routed child does not receive the task body.

The child turn_context confirms that the model override was applied. However, its NEW_TASK message contains an empty plaintext payload followed by a Fernet-looking encrypted_content block. The routed child then reports that no concrete task was provided, or infers an unrelated task from the surrounding system context.

Environment

  • OpenCodex: 2.7.7
  • Codex Desktop / CLI: 0.144.0-alpha.4
  • OS: Windows
  • Proxy mode: loopback, openai_base_url = "http://127.0.0.1:10100/v1"
  • Parent model: gpt-5.6-sol
  • Child model: xai/grok-4.5
  • xAI adapter: openai-chat
  • multiAgentMode: v2
  • fork_turns: "none"

Reproduction

  1. Configure OpenCodex V2 with both native OpenAI and routed xAI models visible.
  2. Start a new Codex Desktop session on gpt-5.6-sol.
  3. Call spawn_agent with a self-contained task, fork_turns: "none", model: "xai/grok-4.5", and a valid reasoning effort.
  4. Inspect the child session and its response.

Example child input shape recorded by Codex:

Message Type: NEW_TASK
Task name: /root/backend_scan
Sender: /root
Payload:
<encrypted_content containing a gAAAA... token>

The child model override is applied correctly, but the child answers along the lines of:

I don't see a concrete task yet—only environment and session setup.

The same result occurred across multiple independently spawned routed children.

Expected behavior

The cross-provider child receives the self-contained task text and executes it.

Actual behavior

The routed child receives the task only as backend ciphertext and cannot read it. No plaintext task reaches the model.

Relevant implementation observations

  • src/responses/parser.ts explicitly treats encrypted_content as opaque to routed models and substitutes [encrypted content omitted] for tool-result content.
  • src/server/responses.ts has sanitizeEncryptedContentInPlace, but it preserves Fernet-looking backend ciphertext.
  • The routed-parent compatibility rewrite around responses.ts lines 456-463 runs only for native-bound requests (!requestedModelId.includes("/")).

This appears to leave the native-parent -> routed-child V2 path without a readable task body. The native backend minted the ciphertext, while the routed provider cannot decrypt it.

Questions

  1. Is native-parent -> routed-child model override expected to work on the V2 collaboration surface?
  2. If yes, where should OpenCodex preserve or recover the plaintext task before forwarding the child request?
  3. If this cannot be fixed at the proxy layer because the task is already backend-encrypted, should V2 guidance avoid fork_turns: "none" for cross-provider children or document a required partial-fork workaround?
  4. Is V1 currently the recommended mode for reliable heterogeneous-provider sub-agents?

I can provide sanitized session fragments or test a proposed patch if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions