invalid_request_error: Invalid 'input[15].arguments': string too long
Open 💬 15 comments Opened Mar 2, 2026 by Gusarich
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
ERROR: {
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "[StringParam] [input[15].arguments] [string_above_max_length] Invalid 'input[15].arguments': string too long. Expected a string with maximum length 1048576, but got a string with length 1524940 instead."
},
"status": 400
}
thread id: 019cafcd-90a8-7d31-8c01-007fe4a00a8a
happened with gpt-5.3-codex-spark, codex-cli 0.107.0-alpha.3, using exec
15 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
have the same issue with latest 0.107.0 cli mode (not exec), I see "Invalid 'input[119].arguments': string too long. Expected a string with maximum length 1048576, but got a string with length
2261315 instead.
happened with spark but changing models doesnt fix the session
{ "error": { "message": "Invalid 'input[531].arguments': string too long. Expected a string with maximum length 1048576, but got a string with length 1508785 instead.", "type": "invalid_request_error", "param": "input[531].arguments", "code": "string_above_max_length" } }
Codex Spark. But swapping back to another model with the existing session doesn't resolve the problem.
same issue for me
Any updates on this?
Definitely the same issue. Any solution?
I am also seeing this issue, tried changing the reasoning level since changing the model doesn't seem to work either but the issue is still present.
Additional reproduction from Codex Desktop on macOS:
After the UI displayed “Context automatically compacted”, the session failed with:
This occurred in the same thread after automatic context compaction. The error prevents the turn from continuing.
Already restarted my app nothing change and im up to date with the latest version:
Version 26.707.72221
Proposed fix (not submitted as a PR because external code contributions are invitation-only; see contributing guidelines).
This report is a concrete
input[*].argumentsreproduction of the older oversized replay payload family reported in #10506, while #13270 captures the function-call-arguments variant.Patch outline
At the request-history formatting boundary in
codex-rs/core/src/client_common.rs:FunctionCallitems whoseargumentsstring is above a conservative 1,000,000-character limit.call_idand matchingFunctionCallOutput.The proposed patch is implemented and locally validated on branch
agent/oversized-tool-arguments-pr, commit9a00d3c00c.Validation:
cargo test -p codex-core client_common::tests: 7 passedgit diff --check: passedclippy::large_enum_varianterror incore-plugins/src/manifest.rs.This avoids blindly truncating active tool calls and prevents a completed historical call from making the next Responses API request invalid.
Additional persistence and recovery evidence from Codex CLI 0.147.0 on Linux
x86_64, using gpt-5.6-sol:
The generated
execcustom tool call had apayload.inputlength of exactly3,726,964 characters. Of those, 3,726,835 were spaces. The non-space portion
looked like the beginning and end of a malformed JavaScript string containing
an
apply_patchrequest.This did not fail only for the originating turn. Codex retained the oversized
tool call in the local session JSONL. Every subsequent user message resent it
as
input[114].inputand failed with the same HTTP 400 before the model couldanswer. Automatic remote compaction also failed with the same error, leaving no
recovery path through the CLI.
I recovered the session manually by preserving the exact response item and
replacing only its oversized
payload.inputwith a short placeholder. Thematching failed tool result and all 310 history records were retained. After
that repair,
codex exec resumesucceeded and the model answered a controlledtest prompt.
This suggests two useful safeguards:
exceeds the API field limit.
history item instead of resending it indefinitely.
I can provide the exact offending response item privately if useful. I would
not post the complete session because it contains personal conversation data.
I'm experiencing a very similar error in the Windows Codex app while using 5.3 Codex Spark:
This has caused the chat to be irrecoverable forcing me to start a new chat in the project. Any follow up prompt leads to the same error being thrown every time.
@JeeveStobs I had the same problem and let another codex session repair it. I just asked "him" how we did it:
Hope they still fix it upstream (does not seem so difficult), but for the meantime this helps...
@ezander thanks, that worked and I was able to archive the two "broken" chats.