You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CLIIssues related to the Codex CLIbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingtool-callsIssues related to tool calling
I hit the same failure class and was able to recover the affected session by editing the persisted rollout JSONL. Adding details in case they help narrow the bug.
Environment:
Current Codex CLI: 0.137.0
Affected session was originally created with Codex CLI: 0.130.0
The issue persisted after upgrading to 0.137.0, so upgrading alone did not repair the affected session.
Platform: Fedora Linux 44, kernel 7.0.9-205.fc44.x86_64
Terminal/multiplexer: tmux 3.6a
Model/provider: OpenAI, gpt-5.5
Observed behavior:
codex resume <thread-id> failed repeatedly with an API 400 shaped like:
[ObjectParam] [input[91].arguments.<garbage>] [property_name_above_max_length]
Invalid property name in 'input[91].arguments': ... is too long.
Expected a string with maximum length 256, but got a string with length 708 instead.
New Codex sessions worked normally; only the affected persisted session failed.
Local transcript diagnosis:
The affected rollout JSONL contained malformed records of type response_item / tool_search_call.
In those records, .payload.arguments was an object with a single garbage property key instead of the expected argument shape.
I found two malformed tool_search_call records in the same rollout file:
one oversized key length was 708
another oversized key length was 566
Each malformed tool_search_call was followed by a function_call_output with:
failed to parse tool_search arguments: missing field `query`
Recovery that worked:
Backed up the rollout JSONL.
Removed the malformed tool_search_call record.
Removed its paired failed function_call_output record.
Removed the adjacent token_count event for that failed tool call.
Re-scanned the JSONL for any remaining .payload.arguments object keys longer than 256 chars.
Found and removed a second malformed tool_search_call block the same way.
After both malformed blocks were removed, the session resumed successfully.
Codex can persist malformed tool_search_call.payload.arguments after tool argument parsing fails. On resume, the persisted transcript is replayed into the API request, and the API rejects the oversized object key before the model can continue. The resume path probably needs to sanitize/drop invalid historical tool calls, or the persistence path should avoid writing malformed tool-call items after argument parsing fails.
I hit the same failure class in Codex Desktop, not just CLI resume.
Observed behavior:
Instead of a normal assistant reply, Codex surfaced the raw API error JSON directly in chat.
The error shape was:
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "[ObjectParam] [input[293].arguments....] [property_name_above_max_length] Invalid property name in 'input[293].arguments': ... Expected a string with maximum length 256, but got a string with length 1709 instead."
},
"status": 400
}
Notable details:
failing path: input[293].arguments
oversized property-name length: 1709
the garbage key contained long multilingual/random-looking text, similar to the malformed tool-call cases already described here
from the user's perspective this looked like Codex itself broke and dumped transport/backend error JSON into the conversation instead of recovering or showing a friendlier failure
This suggests the bug is broader than just a CLI resume edge-case:
malformed tool-call/session state can still be constructed in Desktop
the app may expose the backend validation error directly to the user instead of handling it as an internal failure
If helpful, I can add more reproduction context later, but I wanted to confirm this exact property_name_above_max_length pattern is also happening in Desktop with input[293].arguments.
I hit the same failure class on Codex CLI and was able to narrow one occurrence down to the raw Responses websocket event, before rollout JSONL replay.
Environment:
Codex CLI: 0.139.0
Model: gpt-5.5
Platform: Linux 6.17.0-1016-oracle on aarch64
Originator in telemetry: codex-tui
What I observed:
The affected rollout had 40 tool_search_call response items.
39 had the expected argument shape with query / limit.
2026-06-16T09:05:30Z: raw websocket event response.output_item.done for the same item/call id contained the malformed 2503-character property name in arguments.
The router then logged:
handle_output_item_done:build_tool_call: error=failed to parse tool_search arguments: missing field `query`
Code path that matches the transcript:
codex-rs/protocol/src/models.rs: ResponseItem::ToolSearchCall.arguments is a raw serde_json::Value.
codex-rs/core/src/tools/router.rs: ToolRouter::build_tool_call deserializes that value into SearchToolCallParams { query, limit }, which fails with missing field query.
codex-rs/core/src/stream_events_utils.rs: the FunctionCallError::RespondToModel path records a generic function_call_output with call_id: String::new().
After that, history normalization logs Tool search output is missing for call id: call_0arIzewv9N3HEFLA8hQMNZ5o and synthesizes an empty tool_search_output on later requests.
My current hypothesis:
The original malformed argument object is produced upstream of ToolRouter::build_tool_call because the completed Responses websocket item already contains it.
The client-side bug that makes this harder to recover from is that malformed client-executed tool_search_call parse failures are recorded as an orphan function_call_output with an empty call_id instead of a tool_search_output tied to the original call_id.
A robust fix likely needs two parts:
server/model-side prevention of malformed tool_search_call.arguments, and
client-side hardening so invalid tool_search_call items preserve call_id and do not poison persisted history/resume.
Potential client-side fix shape, if maintainers agree:
Add a regression test for a client tool_search_call with invalid arguments.
When parsing fails before a ToolCall is built, preserve the original call_id and record/respond with a tool_search_output such as tools: [] (or another structured error shape the Responses API accepts for tool_search) instead of function_call_output { call_id: "" }.
Consider a history normalization/resume guard that drops or repairs historical client tool_search_call items whose arguments are not shaped like SearchToolCallParams, to avoid later property_name_above_max_length replay failures.
I have a small client-side hardening patch prepared for the second part above: it preserves the original tool_search_call.call_id and records a tool_search_output instead of an orphan function_call_output { call_id: "" } when client tool_search argument parsing fails.
The local patch is intentionally narrow:
2 Rust files changed
regression test for malformed tool_search_call.arguments
just test -p codex-core handle_output_item_done_preserves_tool_search_call_id_for_invalid_arguments: pass
If this direction matches what the Codex team wants, would you be open to inviting an external PR for this focused client-side fix? I will hold off on opening a PR unless invited, per docs/contributing.md.
Resume should validate persisted tool-call envelopes before replay. If a tool_search_call has malformed arguments, keep the original call id, attach a parse_error record, and emit a matching tool_search_output or repairable skip event. The session should never serialize an orphan output with an empty call id and then fail the whole resume request.
I hit what looks like the same issue on Codex CLI 0.142.3 using gpt-5.5 with xhigh reasoning.
Sanitized sequence from local logs:
A long CLI session triggered context compaction.
After compaction, the session recorded a tool_search_call whose arguments object did not contain the required query field.
Instead, arguments contained a single generated/gibberish multilingual property name with length 6585, value 173.
The next transcript item recorded a failed tool parse with an empty call_id:
failed to parse tool_search arguments: missing field `query`
On the next user turn, session replay sent the malformed item back in the request and the API rejected the whole turn:
invalid_request_error
[property_name_above_max_length]
Invalid property name in 'input[54].arguments': expected maximum length 256, got length 6585
I also saw normalization warnings consistent with poisoned replay state:
Tool search output is missing for call id: <redacted>
Orphan function call output for call id:
This was Codex CLI, not Desktop. Auth/websocket connection appeared healthy, and continuing in a fresh thread worked. The issue seems to be that an invalid internal tool_search_call can be persisted after compaction and then poisons future session replay.
For those still hitting tool-calling issues (namespace doubling, broken HTML rendering): before rolling back to 0.142.5, check whether your install is actually complete.
My symptoms matched what's being reported here, but the root cause turned out to be a missing platform binary — @openai/codex-linux-x64 — not a version regression. The global npm install -g had silently skipped the optional dependency, leaving an incomplete install regardless of version.
That installs codex-linux-x64 into the correct nested location. Currently running 0.143.0 without issue — tool calls passing, HTML rendering correctly.
Independent confirmation from an application embedding @openai/codex-sdk / Codex 0.143.0.
The failure sequence matches this issue:
Codex emitted and persisted a response_item whose payload type was tool_search_call.
The payload's arguments object contained a generated property name longer than 256 characters (985 characters in the observed case).
The original turn was allowed to finish and the rollout was persisted.
On the next resume, the persisted item was replayed as Responses API input.
OpenAI rejected the turn before model output with 400 invalid_request_error, property_name_above_max_length, at input[36].arguments.
The important inconsistency is that Codex can emit/persist a response item that the API will not accept when that same item is replayed as input. This permanently poisons resume for the session unless the client validates the rollout or discards/repairs the invalid item.
A sanitized downstream workaround is to:
validate persisted tool-call argument property names before restoring a rollout;
treat this exact provider rejection as a resume failure;
start a fresh session with reconstructed full conversation history.
Expected upstream behavior: Codex should not persist unreplayable tool-call items, or the resume path should validate/sanitize them before sending history back to the API. No malformed property name or customer/session identifiers are included here.
The original rollout contains two malformed tool_search_call response items. Each arguments object has a single generated multilingual/gibberish property key instead of query; the key lengths are 538 and 1082. The calls were persisted with call IDs, while the following parse-failure outputs have empty call IDs.
After that, every prompt emitted a remote compaction 400 at input[294].arguments with property_name_above_max_length (maximum 256, observed 538). Forking the affected thread did not recover it: the new 0.145.0 fork inherited the poisoned history and failed the same way. A fresh thread with a manual handoff works.
Additional data points:
malformed calls occurred at 2026-07-25T20:03:20Z and 2026-07-25T20:04:42Z
original thread: 019f76b7-afbe-7fe3-b4f5-492eb44ef059
No prompt or repository content is included here. This confirms that upgrading/forking does not sanitize the invalid historical item and that it can permanently break automatic remote compaction, not only explicit resume.
Same failure class here, and I can add two things this thread is missing: it reproduces on the first-party Responses API with no gateway in front of it, and I have per-model rates from a production dataset showing it is ~40x worse on gpt-5.6 than gpt-5.5.
Environment
Endpoint: https://api.openai.com/v1/responses — first-party, no proxy, no Azure/Bedrock
Models: gpt-5.6-terra, gpt-5.6-sol
Streaming, function tools with strict: true, reasoning effort medium/high
Long agentic sessions, 100+ tool calls per conversation
Variant 1: arguments exceed the limit the same API enforces
A single tool call was emitted with 1,126,633 characters of arguments — one array element repeated tens of thousands of times:
400 invalid_request_error
Invalid 'input[167].arguments': string too long. Expected a string with
maximum length 1048576, but got a string with length 1126633 instead.
code: string_above_max_length
The core issue, same as this ticket: the model emits an arguments string that the same API then refuses to accept. Generation and validation disagree.
And as reported here, it is unrecoverable rather than transient. The output is persisted as conversation history, so every later request in that conversation replays it and gets the identical 400. Three such calls landed in one conversation (1,126,633 / 1,062,179 / 751,153 chars) and it could never make progress again. Recovery is impossible client-side without rewriting the model's own recorded output.
Variant 2: chat-template scaffolding and glitch tokens inside arguments
This is the part that matches the "garbled Unicode and mixed-language text" in the original report, and it looks like more than encoding noise. A 32,603-char call contained, inside the arguments JSON:
o200k undertrained/spam tokens: 彩神争霸, 天天中彩票, plus Thai, Armenian and Georgian fragments
the model's own reasoning text, verbatim: "Oops malformed. Need resolve.", "Why tool call formatting malfunction?", "There is serious attempted faulty tool calls? Need actual."
The model appears to notice its output is malformed and attempts to recover by re-emitting tool calls inline as text, which extends the corruption instead of ending it.
This variant is usually under the size limit, so it parses and executes. One built a find with 815 -name clauses and returned normally. No error surfaced anywhere — silent corruption, which is worse than the 400.
Measured incidence
Every tool call in our production database, matched on the markers above:
Model
Tool calls
Degenerate
Rate
First seen
gpt-5.6-terra
5,035
45
0.89%
14 Jul 2026
gpt-5.6-sol
592
4
0.68%
20 Jul 2026
gpt-5.5
9,533
2
0.021%
15 Jun 2026
gpt-5.4
14,936
1
0.007%
14 May 2026
It was present from our first day of using gpt-5.6-terra (14 Jul 2026), which suggests it is inherent to the release rather than a later regression.
Caveats, so nobody over-reads the numbers: this is not a controlled comparison — reasoning-effort mix and prompts varied over the period — and events cluster per conversation (27 of the 45 came from one conversation), so the rate is not an independent per-call probability. Once a conversation degenerates it tends to keep degenerating. The directional gap is large enough that volume alone does not explain it, and 4,383 calls on another vendor's model with zero hits is a useful null.
I hit the same failure mode in a long-running Codex chat using codex-cli 0.147.0 on Linux x86_64. Remote compaction returned HTTP 400 with property_name_above_max_length for input[294].arguments: the malformed property name was 538 characters (maximum 256) and consisted of apparently generated multilingual/random tokens. After the first occurrence, every subsequent prompt in that thread emitted the same remote compact error, so the thread could not recover in place. Moving the task to a new chat via a handoff restored normal operation. I am not attaching the original thread because it contains private infrastructure context, but the stable details are: remote compact task, status 400, input[294].arguments, expected max 256, observed 538. This appears consistent with malformed tool-call arguments being persisted into the compaction input rather than a user-authored property name.
Same root cause, different corruption source: truncated streamed exec_command/apply_patch call poisons the rollout
Hitting this exact "persisted malformed tool-call arguments → 400 on replay → permanently poisoned thread" pattern, but the corruption comes from a stream truncation rather than model-generated gibberish. Documenting it here since the mechanism and the fix are identical.
Setup: Codex CLI pointed at a third-party OpenAI-compatible provider via OpenRouter (free model — provider reported as Nex AGI), Chat/Responses-style tool calling. The model edits files via apply_patch ridden on the exec_command/shell tool (not a declared tool in the tools array).
Sequence:
The model emits an exec_command call: apply_patch <<'PATCH' *** Begin Patch *** Add File: … PATCH. The file is a ~7KB single-file HTML add.
The upstream provider truncates the streamed tool call mid-output. The function_call.arguments string is cut off inside an open HTML tag and is never terminated — the JSON string/object is left unclosed.
Codex persists this partial function_call into the rollout and locally fails to parse it, emitting:
function_call_output: "failed to parse function arguments: EOF while parsing a string at line 1 column 7088"
On the next request, the truncated function_call is replayed into the input. The provider rejects the entire request body at validation time (before inference):
{
"error": {
"message": "Provider returned error",
"code": 400,
"metadata": {
"raw": "{\"error\":{\"message\":\"unexpected end of data: line 1 column 7087 (char 7086)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":\"invalid_request\"}}",
"provider_name": "Nex AGI",
"provider_error_code": "invalid_request"
}
}
}
Note the offsets line up: local parse dies at column 7088, the provider dies at char 7086 — both choking on the same truncation point in the same unterminated arguments blob. The thread is permanently stuck; the model never sees the function_call_output error because the request is refused during validation.
Why this belongs here: same design gap as the tool_search_call case — Codex persists a tool-call item the API will later refuse, then replays it verbatim, and there's no path to recover the thread. The proposed fixes in this issue would cover this variant too:
Validate/sanitize (or drop) historical tool calls with unparseable arguments before replaying them into the request input, preserving call_id.
Additionally, treat a truncated streamed tool call (incomplete arguments / length-cutoff finish reason) as a failed turn and retry it rather than committing the partial call to the rollout.
This makes the bug provider-agnostic but especially easy to reproduce with free/third-party OpenRouter endpoints that truncate large streamed tool calls.
Environment: Codex CLI 0.156.1, model nex-agi/nex-n2.5-pro:free via OpenRouter, macOS.
CLIIssues related to the Codex CLIbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingtool-callsIssues related to tool calling
Activity
YitzhakMizrahi commentedon Jun 4, 2026
I hit the same failure class and was able to recover the affected session by editing the persisted rollout JSONL. Adding details in case they help narrow the bug.
Environment:
0.137.00.130.00.137.0, so upgrading alone did not repair the affected session.7.0.9-205.fc44.x86_643.6agpt-5.5Observed behavior:
codex resume <thread-id>failed repeatedly with an API 400 shaped like:Local transcript diagnosis:
response_item/tool_search_call..payload.argumentswas an object with a single garbage property key instead of the expected argument shape.tool_search_callrecords in the same rollout file:708566tool_search_callwas followed by afunction_call_outputwith:Recovery that worked:
tool_search_callrecord.function_call_outputrecord.token_countevent for that failed tool call..payload.argumentsobject keys longer than 256 chars.tool_search_callblock the same way.The practical jq diagnostic I used was:
Hypothesis:
Codex can persist malformed
tool_search_call.payload.argumentsafter tool argument parsing fails. On resume, the persisted transcript is replayed into the API request, and the API rejects the oversized object key before the model can continue. The resume path probably needs to sanitize/drop invalid historical tool calls, or the persistence path should avoid writing malformed tool-call items after argument parsing fails.menicPL commentedon Jun 4, 2026
I hit the same failure class in Codex Desktop, not just CLI resume.
Observed behavior:
Notable details:
input[293].arguments1709This suggests the bug is broader than just a CLI resume edge-case:
If helpful, I can add more reproduction context later, but I wanted to confirm this exact
property_name_above_max_lengthpattern is also happening in Desktop withinput[293].arguments.ken-jo commentedon Jun 16, 2026
I hit the same failure class on Codex CLI and was able to narrow one occurrence down to the raw Responses websocket event, before rollout JSONL replay.
Environment:
0.139.0gpt-5.56.17.0-1016-oracleonaarch64codex-tuiWhat I observed:
tool_search_callresponse items.query/limit.arguments:{ "type": "tool_search_call", "call_id": "call_0arIzewv9N3HEFLA8hQMNZ5o", "status": "completed", "execution": "client", "arguments": { "<redacted generated multilingual/gibberish key, 2503 chars / 2910 UTF-8 bytes>": [] } }The immediately following rollout item was:
{ "type": "function_call_output", "call_id": "", "output": "failed to parse tool_search arguments: missing field `query`" }Additional evidence from
~/.codex/logs_2.sqlite:2026-06-16T09:04:39Z:stream disconnected - retrying sampling request (3/5 in 733ms)...2026-06-16T09:04:41Z: websocket reconnect succeeded for/responses2026-06-16T09:04:49Z: raw websocket eventresponse.output_item.addedfor the same item/call id:{ "type": "response.output_item.added", "item": { "id": "tsc_0f0cd4c506096518016a3111b1dcb081989865875883ca83ab", "type": "tool_search_call", "status": "in_progress", "arguments": {}, "call_id": "call_0arIzewv9N3HEFLA8hQMNZ5o", "execution": "client" }, "sequence_number": 2 }2026-06-16T09:05:30Z: raw websocket eventresponse.output_item.donefor the same item/call id contained the malformed 2503-character property name inarguments.Code path that matches the transcript:
codex-rs/protocol/src/models.rs:ResponseItem::ToolSearchCall.argumentsis a rawserde_json::Value.codex-rs/core/src/tools/router.rs:ToolRouter::build_tool_calldeserializes that value intoSearchToolCallParams { query, limit }, which fails withmissing field query.codex-rs/core/src/stream_events_utils.rs: theFunctionCallError::RespondToModelpath records a genericfunction_call_outputwithcall_id: String::new().Tool search output is missing for call id: call_0arIzewv9N3HEFLA8hQMNZ5oand synthesizes an emptytool_search_outputon later requests.My current hypothesis:
ToolRouter::build_tool_callbecause the completed Responses websocket item already contains it.tool_search_callparse failures are recorded as an orphanfunction_call_outputwith an emptycall_idinstead of atool_search_outputtied to the originalcall_id.tool_search_call.arguments, andtool_search_callitems preservecall_idand do not poison persisted history/resume.Potential client-side fix shape, if maintainers agree:
tool_search_callwith invalidarguments.ToolCallis built, preserve the originalcall_idand record/respond with atool_search_outputsuch astools: [](or another structured error shape the Responses API accepts fortool_search) instead offunction_call_output { call_id: "" }.tool_search_callitems whoseargumentsare not shaped likeSearchToolCallParams, to avoid laterproperty_name_above_max_lengthreplay failures.ken-jo commentedon Jun 16, 2026
I have a small client-side hardening patch prepared for the second part above: it preserves the original
tool_search_call.call_idand records atool_search_outputinstead of an orphanfunction_call_output { call_id: "" }when clienttool_searchargument parsing fails.The local patch is intentionally narrow:
tool_search_call.argumentsgit diff --check: passcargo fmt -- --config imports_granularity=Item --check: passjust test -p codex-core handle_output_item_done_preserves_tool_search_call_id_for_invalid_arguments: passIf this direction matches what the Codex team wants, would you be open to inviting an external PR for this focused client-side fix? I will hold off on opening a PR unless invited, per
docs/contributing.md.Necmttn commentedon Jun 21, 2026
Resume should validate persisted tool-call envelopes before replay. If a tool_search_call has malformed arguments, keep the original call id, attach a parse_error record, and emit a matching tool_search_output or repairable skip event. The session should never serialize an orphan output with an empty call id and then fail the whole resume request.
Generated with ax.
RaresKeY commentedon Jun 27, 2026
I hit what looks like the same issue on Codex CLI
0.142.3usinggpt-5.5withxhighreasoning.Sanitized sequence from local logs:
tool_search_callwhoseargumentsobject did not contain the requiredqueryfield.argumentscontained a single generated/gibberish multilingual property name with length6585, value173.call_id:I also saw normalization warnings consistent with poisoned replay state:
This was Codex CLI, not Desktop. Auth/websocket connection appeared healthy, and continuing in a fresh thread worked. The issue seems to be that an invalid internal
tool_search_callcan be persisted after compaction and then poisons future session replay.TidyWeb commentedon Jul 9, 2026
For those still hitting tool-calling issues (namespace doubling, broken HTML rendering): before rolling back to 0.142.5, check whether your install is actually complete.
My symptoms matched what's being reported here, but the root cause turned out to be a missing platform binary —
@openai/codex-linux-x64— not a version regression. The globalnpm install -ghad silently skipped the optional dependency, leaving an incomplete install regardless of version.Fix (Linux x64):
That installs
codex-linux-x64into the correct nested location. Currently running 0.143.0 without issue — tool calls passing, HTML rendering correctly.krashidov commentedon Jul 24, 2026
Independent confirmation from an application embedding
@openai/codex-sdk/ Codex0.143.0.The failure sequence matches this issue:
response_itemwhose payload type wastool_search_call.argumentsobject contained a generated property name longer than 256 characters (985 characters in the observed case).400 invalid_request_error,property_name_above_max_length, atinput[36].arguments.The important inconsistency is that Codex can emit/persist a response item that the API will not accept when that same item is replayed as input. This permanently poisons resume for the session unless the client validates the rollout or discards/repairs the invalid item.
A sanitized downstream workaround is to:
Expected upstream behavior: Codex should not persist unreplayable tool-call items, or the resume path should validate/sanitize them before sending history back to the API. No malformed property name or customer/session identifiers are included here.
dannysauer commentedon Jul 25, 2026
Independent confirmation with a newer CLI and a remote-compaction failure mode.
Environment:
0.144.60.145.0gpt-5.5, reasoningxhighremote_compaction_v2enabledThe original rollout contains two malformed
tool_search_callresponse items. Eachargumentsobject has a single generated multilingual/gibberish property key instead ofquery; the key lengths are 538 and 1082. The calls were persisted with call IDs, while the following parse-failure outputs have empty call IDs.After that, every prompt emitted a remote compaction 400 at
input[294].argumentswithproperty_name_above_max_length(maximum 256, observed 538). Forking the affected thread did not recover it: the new 0.145.0 fork inherited the poisoned history and failed the same way. A fresh thread with a manual handoff works.Additional data points:
2026-07-25T20:03:20Zand2026-07-25T20:04:42Z019f76b7-afbe-7fe3-b4f5-492eb44ef059019f9af1-f0f3-7c92-aa41-e132c8765f4cNo prompt or repository content is included here. This confirms that upgrading/forking does not sanitize the invalid historical item and that it can permanently break automatic remote compaction, not only explicit resume.
kangsive commentedon Aug 10, 2026
Same failure class here, and I can add two things this thread is missing: it reproduces on the first-party Responses API with no gateway in front of it, and I have per-model rates from a production dataset showing it is ~40x worse on gpt-5.6 than gpt-5.5.
Environment
https://api.openai.com/v1/responses— first-party, no proxy, no Azure/Bedrockgpt-5.6-terra,gpt-5.6-solstrict: true, reasoning effort medium/highVariant 1: arguments exceed the limit the same API enforces
A single tool call was emitted with 1,126,633 characters of
arguments— one array element repeated tens of thousands of times:The core issue, same as this ticket: the model emits an
argumentsstring that the same API then refuses to accept. Generation and validation disagree.And as reported here, it is unrecoverable rather than transient. The output is persisted as conversation history, so every later request in that conversation replays it and gets the identical 400. Three such calls landed in one conversation (1,126,633 / 1,062,179 / 751,153 chars) and it could never make progress again. Recovery is impossible client-side without rewriting the model's own recorded output.
Variant 2: chat-template scaffolding and glitch tokens inside
argumentsThis is the part that matches the "garbled Unicode and mixed-language text" in the original report, and it looks like more than encoding noise. A 32,603-char call contained, inside the
argumentsJSON:to=functions.glob,to=functions.read_file,ChatGPT to=functions.glob— channel/routing syntax appearing as argument content<|DELIM_nT5|>,】【。system,】【。assistant,+#+#+#+#+#+assistant彩神争霸,天天中彩票, plus Thai, Armenian and Georgian fragmentsThe model appears to notice its output is malformed and attempts to recover by re-emitting tool calls inline as text, which extends the corruption instead of ending it.
This variant is usually under the size limit, so it parses and executes. One built a
findwith 815-nameclauses and returned normally. No error surfaced anywhere — silent corruption, which is worse than the 400.Measured incidence
Every tool call in our production database, matched on the markers above:
It was present from our first day of using
gpt-5.6-terra(14 Jul 2026), which suggests it is inherent to the release rather than a later regression.Caveats, so nobody over-reads the numbers: this is not a controlled comparison — reasoning-effort mix and prompts varied over the period — and events cluster per conversation (27 of the 45 came from one conversation), so the rate is not an independent per-call probability. Once a conversation degenerates it tends to keep degenerating. The directional gap is large enough that volume alone does not explain it, and 4,383 calls on another vendor's model with zero hits is a useful null.
dannysauer commentedon Aug 20, 2026
I hit the same failure mode in a long-running Codex chat using codex-cli 0.147.0 on Linux x86_64. Remote compaction returned HTTP 400 with property_name_above_max_length for input[294].arguments: the malformed property name was 538 characters (maximum 256) and consisted of apparently generated multilingual/random tokens. After the first occurrence, every subsequent prompt in that thread emitted the same remote compact error, so the thread could not recover in place. Moving the task to a new chat via a handoff restored normal operation. I am not attaching the original thread because it contains private infrastructure context, but the stable details are: remote compact task, status 400, input[294].arguments, expected max 256, observed 538. This appears consistent with malformed tool-call arguments being persisted into the compaction input rather than a user-authored property name.
Jufralice commentedon Sep 23, 2026
Same root cause, different corruption source: truncated streamed
exec_command/apply_patchcall poisons the rolloutHitting this exact "persisted malformed tool-call arguments → 400 on replay → permanently poisoned thread" pattern, but the corruption comes from a stream truncation rather than model-generated gibberish. Documenting it here since the mechanism and the fix are identical.
Setup: Codex CLI pointed at a third-party OpenAI-compatible provider via OpenRouter (free model — provider reported as
Nex AGI), Chat/Responses-style tool calling. The model edits files viaapply_patchridden on theexec_command/shell tool (not a declared tool in thetoolsarray).Sequence:
exec_commandcall:apply_patch <<'PATCH' *** Begin Patch *** Add File: … PATCH. The file is a ~7KB single-file HTML add.function_call.argumentsstring is cut off inside an open HTML tag and is never terminated — the JSON string/object is left unclosed.function_callinto the rollout and locally fails to parse it, emitting:function_callis replayed into the input. The provider rejects the entire request body at validation time (before inference):{ "error": { "message": "Provider returned error", "code": 400, "metadata": { "raw": "{\"error\":{\"message\":\"unexpected end of data: line 1 column 7087 (char 7086)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":\"invalid_request\"}}", "provider_name": "Nex AGI", "provider_error_code": "invalid_request" } } }Note the offsets line up: local parse dies at column 7088, the provider dies at char 7086 — both choking on the same truncation point in the same unterminated
argumentsblob. The thread is permanently stuck; the model never sees thefunction_call_outputerror because the request is refused during validation.Why this belongs here: same design gap as the
tool_search_callcase — Codex persists a tool-call item the API will later refuse, then replays it verbatim, and there's no path to recover the thread. The proposed fixes in this issue would cover this variant too:argumentsbefore replaying them into the request input, preservingcall_id.arguments/ length-cutoff finish reason) as a failed turn and retry it rather than committing the partial call to the rollout.This makes the bug provider-agnostic but especially easy to reproduce with free/third-party OpenRouter endpoints that truncate large streamed tool calls.
Environment: Codex CLI
0.156.1, modelnex-agi/nex-n2.5-pro:freevia OpenRouter, macOS.