Codex CLI 0.147.0 rejects Amazon Bedrock input and corrupts subagent handoff
What version of Codex CLI is running?
codex-cli 0.147.0
Control version: codex-cli 0.146.1
What subscription do you have?
Enterprise/BYOK configuration using the built-in Amazon Bedrock provider.
Which model were you using?
openai.gpt-5.6-sol
What platform is your computer?
Darwin 25.5.0 arm64 arm
Codex doctor report
Omitted to preserve anonymization. A separate client feedback record was submitted without logs: 019fdd4b-415c-7761-9709-74545037db3a.
What issue are you seeing?
Codex CLI 0.147.0 rejects a clean request before model output:
validation_error: Invalid 'input': value did not match any expected variant
An interactive thread that called spawn_agent also became permanently unresumable. The child received an empty task payload even though the persisted parent tool arguments contained a nonempty message.
The identical configuration and prompt succeed on 0.146.1; the subagent receives the task and replies OK.
What steps can reproduce the bug?
- Configure Codex to use the built-in
amazon-bedrockprovider andopenai.gpt-5.6-sol. - With
0.147.0, run a clean TTY request from an empty temporary directory using:
``text``
Spawn exactly one subagent with a nonempty task to reply OK; wait and report the response.
- Observe that the initial request fails with the validation error above.
- Run the identical request and configuration with
0.146.1. - Observe that the subagent is created and replies
OK.
What is the expected behavior?
0.147.0 should serialize the Bedrock request and collaboration task identically to 0.146.1, allowing both the initial request and subsequent persisted turns to complete.
Additional information
The version-controlled comparison used the same machine, provider configuration, model, temporary directory, TTY mode, and prompt. This appears to be a 0.147.0 Bedrock input/collaboration serialization regression.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional confirmed reproduction with source-level evidence.
Environment:
codex-cli 0.147.06.17.0-1019-aws)amazon-bedrockprovideropenai.gpt-5.6-sol3aae5d885bac39c1262491aa3fd100dfd8b3919fI reproduced the same validation error from a real interactive rollout. The failure is specifically tied to the internal
agent_messageinput variant.The parent successfully received a namespaced collaboration call:
The spawned child then persisted this as its initial model-visible input:
Before any child model output, Bedrock rejected the request:
There is a second, more damaging failure mode: Codex reports the child error back to the parent as another
type: "agent_message". That item is retained in parent history. The next ordinary user message in the parent thread then fails immediately with the same validation error, so the parent thread becomes effectively unresumable.Relevant current code paths:
codex-rs/protocol/src/protocol.rs:InterAgentCommunication::to_model_input_itememitsResponseItem::AgentMessage.codex-rs/core/src/tools/router.rs:ToolCall::direct_sourceselects plaintext collaboration only whenencrypted_function_args == Some([]).codex-rs/core/src/client.rs: the non-OpenAI request cleanup clears metadata andencrypted_function_args, but does not translate or removeResponseItem::AgentMessagebefore serializing the Responses request.This appears to require both provider-aware collaboration message classification and a non-OpenAI request-boundary representation for
agent_message. Regression coverage should include:The duplicate
Startedlines shown by the TUI are incidental; the provider rejection is reproducible from the persisted request history itself.Additional data point: the provider-incompatible
agent_messageitem also causes strict validation failures on non-ChatGPT backends (Bedrock rejects it withInvalid 'input'on 0.147.0), not just silent payload drops on DeepSeek. This matches the pattern thatagent_message/encrypted_contentare Codex-specific protocol assumptions.For non-OpenAI providers we deliver V2 spawn / followup_task / send_message payloads as plain user messages instead, which avoids the
agent_messageitem entirely and is verified end-to-end: https://github.com/CCanxue/codex-deepseek-subagent-fixCan confirm this also reproduces on
0.147.0via a different trigger path than the original repro: instead of a manualspawn_agentprompt, this happened when an autonomous multi-step task organically spawned a sub-agent mid-session (viaInterAgentCommunication) on modelopenai.gpt-5.6-sol. Every subsequent turn on that same thread then failed identically — the malformedsubAgentActivity/agent_messageitem stays in conversation history and gets re-sent on every turn, so the thread becomes permanently stuck (not just the single spawn call).Client-side trace showed the failing POST to
bedrock-mantle.us-east-1.api.aws/openai/v1/responsescarrying a ~530KBinputarray; server returned:This lines up with #33551's diagnosis —
sol/terraforce Multi-Agent V2 regardless of themulti_agent_v2config flag, and V2'sagent_message/subAgentActivityitem types aren't recognized by Bedrock Mantle's Responses schema. Downgrading to0.146.1avoids it entirely (subagent spawn works normally there).Would be good to see this and #33551 linked/triaged together since they're the same root cause with two different repro paths.
This workaround works for me. Set model catalog and set multi_agent_version to v1
{
"models": [
{
"slug": "openai.gpt-5.6-terra",
"display_name": "GPT-5.6 Terra",
"description": "GPT-5.6 Terra on Bedrock Mantle.",
"priority": 1,
"visibility": "list",
"supported_in_api": true,
"shell_type": "default",
"base_instructions": "",
"supported_reasoning_levels": [],
"supports_reasoning_summaries": true,
"support_verbosity": true,
"supports_parallel_tool_calls": true,
"experimental_supported_tools": [],
"truncation_policy": { "mode": "tokens", "limit": 272000 },
"context_window": 272000,
"web_search_tool_type": "text",
"multi_agent_version": "v1"
}
]
}
Point model_catalog_json at it and set model to the slug:
model = "openai.gpt-5.6-terra"
model_provider = "amazon-bedrock"
model_catalog_json = "/absolute/path/to/catalog.json"
Additional independent reproduction on a newer Codex Desktop/CLI build.
Environment:
26.810.52044(build6662)codex-cli 0.148.0-alpha.926.6.1, arm64amazon-bedrockprovideropenai.gpt-5.6-solus-east-1I reproduced this repeatedly across separate tasks on August 19-21, 2026. In each case, the parent successfully invoked
spawn_agent, but the child rollout started with an internalagent_messagewhose content contained:The child failed before producing any model output:
Codex then delivered that failure back to the parent as another
agent_message. In the Desktop UI, the turn became a system error and the user saw repeated validation-error toasts, effectively killing the active workflow.Workaround validation update
Disabling multi-agent is a safe containment workaround:
I also tested the model-catalog workaround described in this thread: force the Bedrock model to use
multi_agent_version: "v1"and keep multi-agent enabled.Using a temporary catalog derived from Codex's current Sol model definition, I ran a real end-to-end smoke test on the same machine and Bedrock configuration:
OK.This confirms that v1 restores functional Bedrock subagents on
0.148.0-alpha.9; the issue is specific to the v2 wire representation rather than Bedrock model inference generally. The multi-agent version is fixed when a task starts, so this workaround requires a fresh task and will not repair an existing v2-poisoned thread.Current upstream source also contains a Bedrock catalog override that sets
MultiAgentVersion::V1because Bedrock does not support the response items used by v2 (codex-rs/model-provider/src/amazon_bedrock/catalog.rs). That suggests the v1 fallback is the intended compatibility behavior, although it is not effective in this bundled Desktop build.I can provide sanitized rollout excerpts if a maintainer needs additional evidence, but the full rollouts contain private project context.
I can reproduce this issue in the Codex macOS app when using Amazon Bedrock.
Environment
Reproduction
Observed behavior
The Bedrock subagent appears to receive the delegated task as plaintext inside an encrypted_content input variant. The subagent starts, but the handoff fails and it cannot process the delegated task correctly.
This looks consistent with the issue reported here, but I wanted to confirm that it is still reproducible in Codex App 26.818.21641 / bundled runtime 0.148.0-alpha.21.
Happy to provide the failed Bedrock session and successful OpenAI control session if that would help with debugging.
we are working on the v2 fix with bedrock team. for now, we rolled out patch to disable: fixed by falling back to v1 in PR #39804.
Desktop hotfix 26.818.32112 began rolling out August 21.
For cli only alpha has it (starting with 0.150.0-alpha.2). We'll get out a main release soon with this patch.