codex - 💡(How to fix) Fix Remote compact task consistently times out on CLI (author login), while API-compatible provider path works [2 comments, 2 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#19979Fetched 2026-04-29 06:24:19
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2unlabeled ×1
Compaction via author login backend consistently times out and breaks sessions,
while API-compatible provider paths complete successfully.

This strongly suggests a backend-specific compaction issue rather than a local environment problem.

Error Message

Error running remote compact task: timeout waiting for child process to exit After this error, the session becomes unusable and cannot continue. This suggests inconsistent error handling or fallback behavior across clients.

Root Cause

Compaction via author login backend consistently times out and breaks sessions,
while API-compatible provider paths complete successfully.

This strongly suggests a backend-specific compaction issue rather than a local environment problem.

Fix Action

Workaround

Using an OpenAI API key via an API-compatible provider (proxy) avoids the issue

Code Example

Error running remote compact task: timeout waiting for child process to exit

---

Compaction fails 100% of the time and the session becomes unusable

---

Compaction triggers a remote task
→ the task does not return in time (or stalls)
CLI throws:
   "timeout waiting for child process to exit"
→ session is effectively broken

---

curl https://chatgpt.com/backend-api/codex/responses/compact

---

Compaction → timeout → session unusable

---

Compaction"Context compacted"
→ session continues normally

---

Different backend paths for compaction behave differently

---

- Long-running sessions are effectively unusable in CLI with author login
- Compaction failure permanently breaks the session
- Blocks real-world engineering workflows

---

Using an OpenAI API key via an API-compatible provider (proxy) avoids the issue

---

Compaction via author login backend consistently times out and breaks sessions,
while API-compatible provider paths complete successfully.

This strongly suggests a backend-specific compaction issue rather than a local environment problem.
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

ChatGPT (author login)

Which model were you using?

gpt-5.4,gpt-5.5

What platform is your computer?

Ubuntu Linux 22.04.01

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

SSH terminal (xterm)

What issue are you seeing?

Error running remote compact task: timeout waiting for child process to exit

After this error, the session becomes unusable and cannot continue.

What steps can reproduce the bug?

  1. Use Codex CLI with author (ChatGPT) login

  2. Start a long-running task (e.g., multi-file code analysis)

  3. Let the context approach the token limit

  4. Trigger:

    • Automatic compaction, or
    • Manual /compact

Result:

Compaction fails 100% of the time and the session becomes unusable

What is the expected behavior?

Compaction triggers a remote task
→ the task does not return in time (or stalls)
→ CLI throws:
   "timeout waiting for child process to exit"
→ session is effectively broken

Additional information

✔ Network connectivity is normal

Tested:

curl https://chatgpt.com/backend-api/codex/responses/compact

Returns quickly (HTTP 405 without proper method/auth), indicating connectivity is fine.


✔ Local environment is normal

  • Node / npm versions are valid
  • Fresh reinstall does not resolve the issue
  • No unusual environment configuration

✔ Key observation: behavior differs by backend path

❌ Author login (ChatGPT backend)

Compaction → timeout → session unusable

✅ OpenAI-compatible API provider (via proxy / API key)

Compaction → "Context compacted"
→ session continues normally

This indicates that:

Different backend paths for compaction behave differently

✔ Cross-platform difference

  • Ubuntu codex-cli → consistently fails
  • Windows Codex (same account) → does not crash (though quality may degrade)

This suggests inconsistent error handling or fallback behavior across clients.


Impact

- Long-running sessions are effectively unusable in CLI with author login
- Compaction failure permanently breaks the session
- Blocks real-world engineering workflows

Questions

  • What exactly is the "remote compact task"?
  • Why does it fail consistently on the ChatGPT backend path?
  • Is there a timeout / retry / fallback mechanism?
  • Why does failure result in a fatal session state instead of recovery?

Workaround

Using an OpenAI API key via an API-compatible provider (proxy) avoids the issue

Summary

Compaction via author login backend consistently times out and breaks sessions,
while API-compatible provider paths complete successfully.

This strongly suggests a backend-specific compaction issue rather than a local environment problem.

extent analysis

TL;DR

The most likely fix is to use an OpenAI API key via an API-compatible provider to avoid the compaction issue on the ChatGPT backend.

Guidance

  • The issue seems to be specific to the ChatGPT backend path, as compaction works with an OpenAI-compatible API provider.
  • The fact that the issue occurs consistently on Ubuntu but not on Windows suggests a potential platform-specific problem or difference in error handling.
  • To mitigate the issue, try using an OpenAI API key via a proxy or API-compatible provider, as this workaround has been reported to avoid the compaction failure.
  • Investigate the "remote compact task" and its timeout mechanism to understand why it fails on the ChatGPT backend.

Example

No specific code example is provided, as the issue seems to be related to the backend and client interaction rather than a specific code snippet.

Notes

The issue may be related to differences in backend paths, error handling, or fallback behavior across clients and platforms. Further investigation is needed to determine the root cause.

Recommendation

Apply the workaround by using an OpenAI API key via an API-compatible provider, as this has been reported to avoid the compaction issue on the ChatGPT backend. This approach allows for continued use of the CLI without session breaks due to compaction failures.

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

codex - 💡(How to fix) Fix Remote compact task consistently times out on CLI (author login), while API-compatible provider path works [2 comments, 2 participants]