Remote compact exceeds 131072 input-item limit during Goal on Codex CLI 0.155.0
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
codex-cli 0.155.0
What platform are you using?
WSL2
Which model were you using?
gpt-6-astra with ultra reasoning effort.
Was multi-agent/subagent mode used?
No.
What issue are you seeing?
A long-running Codex CLI session hit an automatic remote compaction failure while Goal mode was active.
The workflow was:
- Run
/review, which produced multiple findings. - Start
/goalwith the objective to fix those findings. - Let Goal continue working normally.
- Codex automatically triggered context compaction; I did not manually run
/compact. - The remote compact task failed because the input array exceeded the endpoint limit.
Confirmed error:
Error running remote compact task: {
"error": {
"message": "Invalid 'input': array too long. Expected an array with maximum length 131072, but got an array with length 159085 instead.",
"type": "invalid_request_error",
"param": "input",
"code": "array_above_max_length"
}
}
The affected archived rollout is approximately 900 MiB (943,450,615 bytes) and contains 244,783 JSONL records.
The archived rollout confirms this sequence:
/reviewcompleted successfully and produced the findings.- Goal was then activated to fix those findings.
- The Goal turn started normally.
- After about 228 seconds, that turn ended with the remote compact error above.
After that confirmed failure, Codex later displayed:
Compacting context
└ Making room to continue.
I waited for roughly 10 minutes without seeing a completion or visible progress signal, then interrupted it with Esc.
I cannot confirm whether that later compaction attempt had internally failed or whether it would eventually have completed. The confirmed bug is the earlier array_above_max_length failure.
Expected behavior
The automatic compaction path should never submit a request whose input item count is already above the remote compaction endpoint's accepted limit.
Possible safe behaviors include:
- triggering compaction earlier;
- trimming/chunking the compact input;
- performing staged compaction;
- providing a recovery path if the thread has already crossed the input-item limit.
A failed automatic compaction should also not leave a long-running thread effectively stuck.
Additional context
This may be related to #23694, which reported a similar remote compact failure on older Codex versions with a 16384-item limit and was later closed as completed.
This reproduction occurs on 0.155.0 with the newer 131072-item limit, so it may be a new edge case or regression in the current compaction pipeline rather than an exact duplicate.
The affected session has been archived. I can provide redacted excerpts from the archived rollout if maintainers need them, but I have not attached the full rollout because it contains project/session content.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the automatic remote compaction path in the Rust Codex CLI and reproduce the failure with the archived rollout or an equivalent oversized input. Check how input-item limits and compaction failures are handled; done means automatic compaction never submits more than 131072 items and a failed attempt leaves the thread recoverable rather than stuck.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100