🗜️

Codex: Error Running Remote Compact Task

When a Codex conversation gets close to the model's context limit, Codex compacts it: it sends the history to OpenAI's servers to be summarized so the thread can keep going. 'Error running remote compact task' means that summarizing step failed. The part after the colon gives the reason. 'stream disconnected before completion' (often with 'error decoding response body' or 'error sending request for url ... /codex/responses/compact') is a connection that broke during compaction; 'request timed out' or 'timeout' means compaction took too long, which is common on very large threads; 'We're currently experiencing high demand' is OpenAI capacity; and messages like 'unexpected status 404' or 'Unknown parameter' have appeared after client and server versions drifted apart. Because compaction runs exactly when a thread is at its largest, retrying the same compaction often fails again. The dependable fix is to save a short checkpoint, start a fresh thread, and carry over only what the next step needs.

Recommended toolMercorGet paid to use your expertise training and evaluating AI for leading AI labs.Join Mercor

Affiliate link, we may earn a commission at no extra cost to you.

Symptoms You Might See

⚠️

Codex stops with 'Error running remote compact task' after a long session

⚠️

The message continues with 'stream disconnected before completion' or 'error sending request for url'

⚠️

Auto-compaction fails after a long wait, sometimes around two and a half minutes

⚠️

Running /compact by hand fails the same way

⚠️

A context-window message ('Codex ran out of room') appears alongside the compact error

Common Causes

The thread is too large to summarize reliably

Compaction has to send and process the whole long history. On very large threads this is slow and is the step most likely to time out or drop, which is why the error shows up at the end of long sessions.

A network break during compaction

The compaction request is a network call to OpenAI's compact endpoint. Proxies, VPNs, unstable Wi-Fi or an OpenAI incident can break it in the same way as a normal Codex stream.

OpenAI capacity or incidents

During high demand the compact task can be rejected with a high-demand message or fail with server errors. These are fixed on OpenAI's side.

Client and server versions out of step

Several reports (404 Not Found, Unknown parameter) were tied to specific Codex app or CLI versions. Updating usually clears these.

Step-by-Step Fixes

1

Save a checkpoint, then start a new thread

When to try: First, when compaction fails on a long thread

Write down the goal, what is done, what remains and the files that matter (ask Codex for a short handoff if it still responds). Run /new in the CLI or open a new chat in the app, paste the checkpoint, and ask it to inspect only the files it needs. This is the fix SmartScope and many GitHub reporters land on, because it avoids compacting the oversized history at all.

2

Check the working tree before continuing

When to try: Every time you move to a new thread

Starting a new thread does not undo file changes. Run git status and git diff --stat so the new thread does not repeat edits that already landed.

3

Retry /compact once, earlier next time

When to try: When you want to keep the same thread

If the thread still responds and continuity matters, try /compact once. Running it before the thread is at its limit gives compaction less to process. If it fails again, do not keep retrying the same compaction; move to a new thread.

4

Check status.openai.com

When to try: When the error appeared suddenly across threads

If the error mentions high demand, timeouts or server errors, look for a Codex incident. During incidents, waiting is faster than retrying.

5

Update Codex

When to try: When the error mentions 404 or an unknown parameter

Update the CLI, IDE extension or desktop app and restart it. Version mismatches have caused 404 and unknown-parameter compact errors that disappear after updating.

6

Check your network path

When to try: When compaction fails on a stable thread size

If the error says 'error sending request for url', try without VPN or proxy, or on another network, to rule out something blocking the compact request.

How to Prevent This

✓

Use one thread per task and start fresh when the task changes

✓

Name the relevant files instead of pasting whole logs into the chat

✓

Keep reusable project guidance in AGENTS.md rather than repeating it in chat

✓

Compact manually before a thread is near its limit, not after

When to Contact Support

Report it when compaction fails on modestly sized threads, fails on every thread, or keeps failing with no incident on the status page. Use /feedback to attach logs and file an issue on github.com/openai/codex with your version, platform and the exact error text.

Frequently Asked Questions

What is the remote compact task in Codex?▼

It is the step where Codex sends a long conversation to OpenAI to be summarized so the thread fits back inside the model's context window. The error means that summarizing call failed.

Does codex resume fix a failed compaction?▼

No. codex resume reopens a previous conversation with its full history, so it does not make the thread smaller. To get past a failed compaction, start a new thread with a short checkpoint.

Will I lose my work if compaction fails?▼

Your files stay as they are. What you lose is the conversation's working memory, which is why you write a short checkpoint before starting the new thread.

Why does it fail after about two and a half minutes?▼

Users on the Codex issue tracker report auto-compaction timing out after roughly 150 seconds on large threads. A timeout means the history was too large or the connection too slow to finish summarizing in time.

How do I avoid it?▼

Keep threads focused on one task, start a new thread when the task changes, and compact before the thread is huge. Smaller threads compact faster and fail less.

Other Common AI Errors

⚠️

ChatGPT Not Working

Service Issues

🚦

Rate Limit Exceeded

Usage Limits

📏

Context Length Exceeded

Input Limits

🔥

Model Overloaded

Service Issues

Don't stop here

What to read next

Hand-picked guides our readers explore right after this one.