codex - 💡(How to fix) Fix automatic triggered "remote compact task" never works (Error running remote compact task: stream disconnected before completion) [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20160Fetched 2026-04-30 06:33:02
View on GitHub
Comments
3
Participants
4
Timeline
12
Reactions
0
Author
Timeline (top)
labeled ×5commented ×3renamed ×2cross-referenced ×1

Error Message

Error message: Error running remote compact task: stream disconnected before completion: error sending request for url

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4, gpt-5.5

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

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

Powershell/CMD/VSCode (no difference)

What issue are you seeing?

On an automatic compact, the process fails. A manual "/compact" afterwards fails too. No chance to get the session running again.

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

The direct internet connection is stable and has no influence on this behaviour.

A manual "/compact" before the context-window is reached occasionally works.

What steps can reproduce the bug?

Fill session up till the context window limit is reached. The automatic compact-task and following manual /compact then fails.

What is the expected behavior?

That the compact works...

Additional information

No response

extent analysis

TL;DR

The issue may be related to the automatic compact task failing due to a stream disconnection, and a potential workaround is to manually run the compact task before the context window limit is reached.

Guidance

  • The error message suggests a stream disconnection issue, which might be related to the automatic compact task timing out or failing to complete.
  • To verify, try manually running the compact task before the context window limit is reached, as mentioned in the issue, to see if it works occasionally.
  • Investigate if there are any network or server-side issues that could be causing the stream disconnection, despite the direct internet connection being stable.
  • Consider checking the Codex CLI documentation or support resources for any known issues or workarounds related to the compact task and stream disconnections.

Notes

The issue lacks detailed information about the network setup, server configuration, or any recent changes that might have caused this behavior, which could be crucial in identifying the root cause.

Recommendation

Apply workaround: Manually run the compact task before the context window limit is reached, as this has been reported to work occasionally, while further investigation is done to identify the root cause of the automatic compact task failure.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING