Error running remote compact task
The message
Error running remote compact taskWhat it means
Codex tried to shrink a long conversation by asking OpenAI's server to summarize it, and that request failed. The words after the colon are the actual failure, passed through from another error.
What to do
Read the text after the colon and treat it as the real error. If the thread keeps failing while new ones work, carry the task into a new thread. If the line names /responses/compact, update Codex.
This line is only half an error message. Codex puts the words in front of whatever went wrong while it was compacting your conversation, so what you actually see is always longer:
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
A GitHub search on September 25, 2026 found 276 issues in openai/codex quoting the prefix. We read the compaction code in the 0.157.0 release and went through the threads to see which endings people get and what each one means.
What remote compaction is
Every model has a context window, and a long Codex session eventually fills it. Compaction is how Codex keeps going: it swaps the older part of the thread for a condensed version and carries on. It fires on its own when usage crosses a threshold, and you can force it with /compact.
"Remote" means OpenAI's server does the condensing. Codex sends the thread up as an ordinary request and expects a single compaction item back, then rebuilds the history around it, keeping your recent messages up to 64,000 tokens. Only the built-in OpenAI provider, Azure and Amazon Bedrock get this path. Other providers compact differently, and their failures never carry this prefix.
Why the prefix hides the real error
In the source the prefix is glued on with a colon and nothing else, so the rest of the line is another error's text, unchanged. That's the part to search for. Roughly half the 276 issues also quote "stream disconnected", which makes the network the most common cause by a wide margin.
One detail explained a lot of the reports for us. A compaction request gets two retries, where a normal turn gets five, and the code comment says why: compaction "can run much longer than normal turns". So a connection that survives ordinary turns can still lose a compaction, and you'll see Reconnecting... 2/2 just before it gives up.
The endings people see, and what each one means
stream disconnected before completion. The reply was cut off mid-stream. The causes and fixes are the same as for the standalone error, covered on our page for “stream disconnected before completion”. People in the threads cleared it by toggling a VPN or Wi-Fi, or by switching model for one compaction.
You've hit your usage limit. The summary is a model request and counts against your plan like any other. See the usage limit page.
Request blocked. That text comes from OpenAI's server, not from Codex. In July several people reported every request in one thread being blocked, compaction included, and one commenter narrowed it to a single string in the context, <|channel|>analysis (a marker some open-weight chat templates use). Another hit it while editing a llama.cpp template. A different user got past it by compacting once on a 5.5 model and switching back.
Codex ran out of room in the model's context window. The conversation had outgrown what the model could take in even for summarizing. The message's own advice is the fix: start a new thread or clear earlier history.
unexpected status 404 Not Found, often naming /responses/compact. Codex used to call a separate compaction endpoint. Eric Traut of OpenAI wrote on June 29, 2026 that it had moved to "the same endpoint as normal turns", and the 0.157.0 source has no /responses/compact URL anywhere. If your error names it, your Codex is older than that switch, so update it first.
When one thread keeps failing
The painful version is a thread where every compaction fails, while new ones in the same project work. A September 7 report on issue #38969 describes exactly that, and it's still open. Codex saves the prompt you'd just typed when compaction fails before a turn (the code says so in a comment), so you haven't lost it. Copy the task into a fresh thread and continue there.
One user's workaround on the March thread was to run /compact by hand and then tell the agent to continue. Back in March, a user traced one timeout to a 30-second TCP setting and proposed raising it. Traut declined, saying it "papers over an underlying latency issue". If you're stuck, run /feedback straight after a failure so the logs reach OpenAI.
Other lines the same feature prints
Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)Error running remote compact task: stream disconnected before completion: Transport error: network error: error decoding response bodyError running remote compact task: Request blocked.Error running remote compact task: Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.Error running remote compact task: unexpected status 404 Not Found