Skip to content

Remote compact task timeout -> session becomes unrecoverable (resume also hangs) #16278

Closed

Description

@priyanshuchawda

What version of Codex CLI is running?

0.117.0

What subscription do you have?

ChatGPT Go

Which model were you using?

gpt-5.4 xhigh

What platform is your computer?

Linux 6.17.0-19-generic x86_64 x86_64

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

GNOME Terminal (zsh)

What issue are you seeing?

Codex CLI consistently fails during the automatic context compaction phase when the context usage drops from ~100% to ~10–20%.

Error:

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

After this happens:

Retrying does not work
The session becomes stuck
Restarting the terminal does not fix it
Attempting to resume the session also hangs indefinitely

Example:

codex resume 019d3ffb-e428-79d1-99c3-17d5052fe1a6

This command never completes and appears to freeze.

Additionally:

The session becomes completely unusable after failure
There is no way to recover past context
The only workaround is to start a new Codex session from scratch, losing all previous progress

What steps can reproduce the bug?

Uploaded thread: 019d3ffb-e428-79d1-99c3-17d5052fe1a6

Start a Codex session on a medium/large multi-file project
Perform multiple steps (planning, edits, reasoning)
Let context grow close to 100%
Wait for automatic compaction to trigger
Observe failure during compact phase

After failure:
Try retry -> stuck
Restart terminal -> still stuck
Run codex resume <thread_id> -> hangs indefinitely

What is the expected behavior?

Context compaction should complete successfully
If compaction fails, session should still be recoverable
codex resume should always restore the session instead of hanging

Additional information

Issue seems correlated with large context size and long sessions
Failure happens exactly during compaction (context drop phase)
After failure, session appears to be in a corrupted or locked state
Resume functionality does not recover the session
Similar timeout/child-process issues have been reported in Codex CLI related to subprocess handling ()

Blocks long-context workflows entirely
Forces restarting from scratch after failure
Causes complete loss of session context and progress
Makes Codex CLI unreliable for larger or multi-step projects

Activity

  1. added
    bug
    on Mar 30, 2026
  2. added
    context
    on Mar 30, 2026
  3. etraut-openai commented on Jun 29, 2026

    @etraut-openai
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcontextperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions