Compaction failure

Resolved 💬 15 comments Opened May 4, 2026 by BottyBott Closed Jun 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.128.0

What subscription do you have?

PRO

Which model were you using?

5.5 xhigh

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

VSCode

What issue are you seeing?

■ Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
Compaction almost never works, leaves session hung and ends current conversations. When I keep telling it to proceed in order to restart compaction, sometimes it just resets with no context at all.

What steps can reproduce the bug?

Have codex compact the context.

What is the expected behavior?

Expected behavior is context compaction and session continuation

Additional information

_No response_

View original on GitHub ↗

15 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #20439
  • #20272
  • #19558
  • #19660
  • #19441

Powered by Codex Action

skypher · 2 months ago

Can confirm sth similar:

› continue work ■ Error running remote compact task: We're currently experiencing high demand, which may cause temporary errors.

Doesn't seem to go away until a new session is started.

nextdimension · 2 months ago

just happened to me

nextdimension · 2 months ago

■ Error running remote compact task: {
"error": {
"message": "Unknown parameter: 'safety_identifier'.",
"type": "invalid_request_error",
"param": "safety_identifier",
"code": "unknown_parameter"
}
}

nextdimension · 2 months ago

0.128.0

JialinLiu-codedance · 2 months ago

just happened to me. It's not just CLIs, apps encounter the exact same issues.

presidenzo · 2 months ago

Also seeing this on Codex Desktop for macOS.

Thread ID: 019e0390-d329-74c3-b8ab-13a32d339c9b
Codex App: 26.429.61741 (2429)
Error:

Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)

This is still happening today (2026-05-07).

mahdikayvan · 2 months ago

@BottyBott Hey — I know this kind of issue too well. It is very close to the agent reliability problem I’m working on.

I’m building AgaveCore, and I’d like to let a few early people use it for free while I shape it into something stronger.

It helps when a coding agent starts to drift, loses important context, or gives you an output you do not fully trust.

In practice, it works through two habits:

  • tell the agent to remember-progress or remember-this when something important should not be lost
  • use consult-brain when the current task needs more grounded feedback on what to do next

Over time, as useful journals, decisions, and failures pile up, the product should help the agent make sharper decisions and take better actions with less drift.

If this sounds relevant, reply here and I’ll send the exact steps. You can also use the email or Telegram on my profile.

Cheers,
Mads.

MikeK184 · 2 months ago

still have that issue, quite annoying as it happens frequently

BottyBott · 2 months ago

<img width="1097" height="422" alt="Image" src="https://github.com/user-attachments/assets/331f4bf3-f64d-42a8-841d-dce1a6577369" />

PommesPeter · 2 months ago
<img alt="Image" width="1097" height="422" src="https://private-user-images.githubusercontent.com/133533356/592686621-331f4bf3-f64d-42a8-841d-dce1a6577369.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Nzg5MjEyNDYsIm5iZiI6MTc3ODkyMDk0NiwicGF0aCI6Ii8xMzM1MzMzNTYvNTkyNjg2NjIxLTMzMWY0YmYzLWY2NGQtNDJhOC04NDFkLWRjZTFhNjU3NzM2OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNTE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDUxNlQwODQyMjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMTM1ZTA4OWNjMGJjNzk2MjQyNjc4MWYzYWVlOTY4ODA2NTM2ZDQ0YTQ2MmMyZGJkZmZmYzMxODA4ZTcwZDRiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.01_qZ8D9UvSkrClfqbveqpzOBhjlp899MSUTx9gTfoo">

Here's a temporary workaround:

  1. Switch the model to gpt-5.4-mini
  2. Send a message to trigger the compaction
  3. Switch back to your previous model
  4. Continue the conversation
mstapink · 2 months ago

The temporary workaround no longer works. I can no longer compact context in any of my open chats. My work cannot be continued until I am able to compact context again.

no-active-thread-019e4b81-5a50-7081-aac2-a85da3bb5f81

sunpihai-up · 1 month ago

I encountered the same bug, and upgrading Codex to the latest version v0.133.0 didn't work either. This bug is critical! Please prioritize this issue!!

garyfpga · 1 month ago

have the same problem
when is it going to be fixed? It is very annoying

etraut-openai contributor · 21 days ago

Thanks for reporting this problem. Until recently, Codex used a separate endpoint and server-side logic for compaction. We recently switched to a more robust approach where the compaction logic is moved locally using the same endpoint as normal turns. This eliminates "remote compaction" errors and increases the stability and reliability of compaction operations. If you see further problems with compaction, please use /feedback and open a new bug report.