Skip to content

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

Closed

Description

@binlin1973

What version of Codex CLI is running?

codex-cli 0.114.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.4

What platform is your computer?

Linux 5.15.0-171-generic x86_64 unknown

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

XSHELL

What issue are you seeing?

• Explored
└ Read rtos_sip_log.h, rtos_sip_log.c
Search sAPI_enableDUMP|sAPI_Debug( in sc_application.c

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

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Feedback uploaded. Please open an issue using the following URL:

https://github.com/openai/codex/issues/new?template=3-cli.yml&steps=Uploaded%20thread:%20019ce5d4-3285-7cd0-afee-e42820ed3ec7

Or mention your thread ID 019ce5d4-3285-7cd0-afee-e42820ed3ec7 in an existing issue.

› HI

■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit /feedback to report the issue.

› HI

■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit /feedback to report the issue.

› Run /review on my current changes

What steps can reproduce the bug?

Uploaded thread: 019ce5d4-3285-7cd0-afee-e42820ed3ec7

What is the expected behavior?

Response but no more until Ctrl+c

Additional information

No response

Activity

  1. added
    contextIssues related to context management (including compaction)
    on Mar 14, 2026
  2. initpwn commented on Mar 19, 2026

    @initpwn
  3. minanagehsalalma commented on Apr 10, 2026

    @minanagehsalalma

    I’m also hitting this on Linux with the latest stable CLI, and it is breaking resume/continuation of long-running threads.

    Environment

    • Codex CLI: 0.118.0
    • Install method: global npm package @openai/codex
    • OS: Ubuntu Linux
    • Model: gpt-5.4

    Problem
    Long-running interactive sessions repeatedly fail with:

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

    Image

    This is not isolated to one repo. It has happened across unrelated projects on the same machine and can leave the affected thread effectively unusable.

    What I observed locally

    • The exact error has occurred 24 times in ~/.codex/log/codex-tui.log.
    • It reproduces across multiple sessions/projects.
    • Example affected session id: 019d77ed-a71a-72a1-9a6f-7d2587adb2c4
    • Resume is not a reliable recovery path once a thread gets into this state. The next turn can hit the same compaction failure again.

    Representative log details
    From ~/.codex/log/codex-tui.log:

    codex_core::compact_remote: remote compaction failed ... compact_error=timeout waiting for child process to exit

    One representative instance logged:

    • last_api_response_total_tokens=238609
    • all_history_items_model_visible_bytes=788672
    • failing_compaction_request_model_visible_bytes=803365
    • model_context_window_tokens=Some(258400)

    Why this looks like a Codex bug rather than local corruption

    • 0.118.0 is already the latest stable npm release here.
    • The failure pattern is consistent across different projects.
    • Resume does not consistently recover the thread.
    • From upstream source, the compaction teardown path appears to have a 10-second shutdown timeout, which may be too aggressive for this case.

    Impact

    • Long threads become fragile or effectively unusable.
    • codex resume <session-id> is not dependable once the thread is affected.
    • This causes real work loss because the user cannot continue the same conversation even after restarting.

    Partial workaround
    I lowered model_auto_compact_token_limit in ~/.codex/config.toml so compaction happens earlier on future turns/threads. That may reduce recurrence, but it does not reliably recover already-affected
    threads.

    Requested improvement

    • Fix the compaction-thread shutdown timeout path on Linux.
    • Make resume more resilient for already-affected threads.
    • If compaction shutdown times out, a degraded but resumable recovery path would be much better than leaving the thread stuck.
  4. minanagehsalalma commented on Apr 11, 2026

    @minanagehsalalma

    I have a ready fix for the compaction failure path reported here, but openai/codex is currently collaborators_only for PR creation, so I cannot open the PR directly from my account.

    Branch: minanagehsalalma:fix/remote-compact-timeout-recovery
    Commit: ea2504064
    Compare: https://github.com/openai/codex/compare/main...minanagehsalalma:fix/remote-compact-timeout-recovery?expand=1

    This patch addresses both the misleading timeout surfaced in this issue and the large-session remote compaction timeout path tracked in #14860.

    What the patch does:

    • maps API transport timeouts to CodexErr::RequestTimeout
    • keeps the child-process timeout wording for actual child-process failures only
    • applies compact-request timeout/compression behavior consistently
    • falls back to local compaction on remote compact timeout
    • skips obviously timeout-prone oversized remote compaction attempts up front

    Validation I ran locally:

    • targeted timeout fallback test passed
    • targeted oversized preflight-skip test passed
    • compact_remote: 25 passed, 1 ignored
    • compact_resume_fork: 4 passed
    • request_compression: 4 passed

    Prebuilt binary handoff:

    Credit:

    Routing note:

    • recent ownership in the touched path points to @aibrahim-oai on core compaction work and @jif-oai on the compact API path

    If a collaborator is willing, please open the PR from the compare link above so it can be reviewed and linked back to these issues.

  5. 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

    bugSomething isn't workingcontextIssues related to context management (including compaction)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions