Error running remote compact task: stream disconnected before completion
Main chat
A chat for vibe coders: news, guides, live cases, marketplace, and finding executors.

If you’re actively working on Codex (app, CLI, or integration), you’ve probably encountered this error before:
*Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact) **
In May-June 2026, this problem became widespread. It is especially common in users of GPT-5.5 with automatic or manual context compression (/compact).
Why does this mistake occur
The main reasons (according to user reports on GitHub, Reddit and OpenAI forums):
Problem with GPT-5.5 OpenAI doesn’t seem to have full remote compaction support for the new 5.5. When the context approaches the limit (usually 200-250k+ tokens), the compression attempt drops.
Timeouts and streaming shutdowns The request for
/compacttakes too long and the connection is terminated.Network problems and providers VPNs, corporate networks, Zscaler, unstable Internet or problems with TLS certificates.
Bugs in specific versions Often found in Codex Desktop (Mac/Windows) and CLI after updates.
Working decisions (from the most effective)
The most reliable method (works for 80-90% of users):
- Switch to GPT-5.4 Mini (or 5.3 Mini).
- Write a simple message to chat, for example:
Сожми контекстor/compact. - Wait for a successful compression.
- Switch back to GPT-5.5.
After that, the session is usually stabilized.
** Other verified fixes:**
Increase timeout in Codex configuration (
~/.codex/config.tomlor similar file):tomlstream_idle_timeout_ms = 900000 # 15 минутAdd to the config
tomlmodel_auto_compact_token_limit = 192000
This forces you to compress the context earlier when there is still enough space.
- **Create a new chat, sometimes it helps radically.
- Update Codex to the latest version.
- Disable the VPN/corporate proxy during operation.
- For Windows: Update system root certificates.
Comparison of decisions
| Решение | Сложность | Эффективность | Когда использовать |
|---|---|---|---|
| Смена модели + compaction | Низкая | ★★★★★ | Самый частый случай |
| Увеличение timeout в config | Средняя | ★★★★ | Повторяющиеся обрывы |
| Новый чат | Низкая | ★★★ | Быстрый, но временный фикс |
| Обновление + очистка кэша | Средняя | ★★★ | После обновлений Codex |
What to do next to make the problem less worrying
- Regularly compress the context manually, without waiting for an automatic trigger.
- Use several models: 5.5 for complex tasks, 5.4 Mini for long sessions.
- Go to LiteLLM or local/alternative providers if Codex continues to fail.
- Keep an eye out for OpenAI updates - the bug has been known for a long time and is gradually fixed.
Conclusion
The stream disconnected before completion error in the context of remote compact is one of the most annoying Codex issues of 2026. Fortunately, it does a good job of changing the model while the context is compressed.