Skip to content

Compaction hangs indefinitely at <16% #14425

Open

Description

@guidedways

What version of Codex CLI is running?

v0.114.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4

What platform is your computer?

macOS

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

iTerm2

What issue are you seeing?

Every time now - when the context is around 15% or less, auto-compaction can hang indefinitely (waited for 30 minutes) - it just says "working" but I'm assuming it's compacting since at that point it usually does.

What steps can reproduce the bug?

Give codex some work that would fill up the entire context and force it to compact, after the first or second time it'll just hang on "working" if the context is around 15% or lower.

I end up quitting codex, re-starting (at that time it doesn't even show me the normal resume with ... message) and then manually /resume the session, then run a manual /compact which finally works).

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bug
    on Mar 12, 2026
  2. nilswx commented on Mar 12, 2026

    @nilswx

    You'd think compaction would be good for the cluster: a one-time pass that shrinks session context and reduces future token load. But with sessions hanging for tens of minutes, it almost feels like compaction requests are getting stuck or deprioritized.

    Could this be because compaction replaces the prompt prefix and invalidates existing KV/prompt cache state, forcing the request onto a slower path? It feels like OpenAI is slapping compactions with (counterintuitive) penalization/throttling.

  3. Grallen commented on Mar 14, 2026

    @Grallen

    This may only happen when you use gpt-5.4 instead of a codex model like gpt-5.3-codex. I was able to switch models, compact, and then switch back.

  4. added
    context
    on Mar 23, 2026
  5. timhaak commented on Mar 26, 2026

    @timhaak

    For me, it only happens if it's compacting and I queue a message for after compaction.

  6. piazzatron commented on May 25, 2026

    @piazzatron

    This is still ongoing. And it indeed only happens to me if I queue a message after compaction (thanks @timhaak). Hung for ~15 min. A manual compact finished in <1min.

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