Skip to content

codex just compacts repeatedly for hours at a time before it is able to make a change #14120

Closed

Description

@jamesheinlein

What version of Codex CLI is running?

0.112

What subscription do you have?

Pro

Which model were you using?

5.4-xhigh

What platform is your computer?

darwin m3 max

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

ghostty

What issue are you seeing?

each compaction leaves codex with only like 12% context remaining, and so it is impossible to actually do anything. I'm like "great, can you make the change per the spec and discussion" and then it compacts from 10% to 15%, reads a few files, compacts from 5% to 12%, reads a few files, compacts, reads a few files, compacts, etc.

it has done this about 6 times in a row, and it has not been able to patch a single file yet after around 2 hours, and I bet its understanding of the change I want is degrading due to game of telephone.

this is completely unusable and I did not see the issue on older versions like 0.109 IIRC

What steps can reproduce the bug?

run a session with a bunch of docs and files touched. not really a large change, affecting less than 30 files and 10 docs.

What is the expected behavior?

for the /compact feature to actually /compact context to some reasonable extent, or to overall design the product in a way that makes it possible for the agent to edit code without just sitting there compacting repeatedly for hours.

Additional information

No response

Activity

  1. github-actions commented on Mar 9, 2026

    @github-actions
    Contributor
  2. added
    contextIssues related to context management (including compaction)
    on Mar 9, 2026
  3. ohad7 commented on Mar 11, 2026

    @ohad7

    seeing the same behavior. any workaround?

  4. mercmobily commented on Mar 11, 2026

    @mercmobily

    This is a real problem for me now

  5. ohad7 commented on Mar 11, 2026

    @ohad7

    This is a real problem for me now

    I switched to reasoning effort high instead of xhigh - so far it's working and didn't get stuck

  6. mercmobily commented on Mar 11, 2026

    @mercmobily

    I switched to reasoning effort high instead of xhigh - so far it's working and didn't get stuck

    I reverted to 5.3 and set it to HIGH, and now when I compact it ACTUALLY compacts.
    (I hope this will help devs to find the problem and users to get around it!)

  7. mercmobily commented on Mar 11, 2026

    @mercmobily

    I just realised I used 80% of my quota re-compacting repeatedly... ugh! Watch out people.

  8. apollostreetcompany commented on Mar 11, 2026

    @apollostreetcompany

    they know it's an issue.

  9. adrianabelarde commented on Mar 11, 2026

    @adrianabelarde

    seems a bit fast now after changing it from xhigh to high

  10. CatnyapC commented on Mar 11, 2026

    @CatnyapC

    @jamesheinlein @ohad7 @mercmobily I found that manually stopping all “Codex Helper” processes in Activity Monitor stops Codex from getting stuck while auto-compacting, and then just prompting it with “continue” fixes it for me. Hope this helps!

  11. mercmobily commented on Mar 11, 2026

    @mercmobily

    @CatnyapC Wait I am using codex-cli, I've never used the web version... is there an "activity monitor" in codex-cli too?

  12. martindrapeau commented on Mar 12, 2026

    @martindrapeau

    No, Activity Monitor on MacOS (equivalent to Task Manager in Windows),

  13. CatnyapC commented on Mar 12, 2026

    @CatnyapC

    @CatnyapC Wait I am using codex-cli, I've never used the web version... is there an "activity monitor" in codex-cli too?

    My bad, I assumed you were using the new Codex App. I didn’t realize the CLI version had this auto-compacting issue too, thought it was only an app-side problem, since the app has been pretty bumpy since launch.
    But with how unstable auto-compacting is right now, I think the app version is still worth using, since at least there’s something you can do about it when it's stuck compacting in a loop.

  14. ohad7 commented on Mar 14, 2026

    @ohad7

    i don't experience this bug any more, Been running two days with xhigh codex app, no death spiral. I think it can be closed.

  15. etraut-openai commented on Mar 14, 2026

    @etraut-openai
    Contributor

    We deployed a fix for this. It was a server-side issue. Thanks everyone who reported this problem.

  16. C-o-d-e-C-o-w-b-o-y commented on May 16, 2026

    @C-o-d-e-C-o-w-b-o-y

    I just downloaded Codex and am facing this issue - as soon as my session hits 258k context I literally cannot proceed, it just gets stuck on 'compacting' and then fails repeatedly

  17. kushalj1997 commented on May 26, 2026

    @kushalj1997

    Facing a similar issue - frequent context compacting, despite only 27-30% context usage. Codex is extremely slow at completing work due to this issue. Also happens when I open a new session.

  18. jaylex32 commented on Jun 5, 2026

    @jaylex32

    I'm having this issue compacting after compacting without doing any work and then it wastes all my tokens, that should be reimburse.

  19. umizame commented on Jul 2, 2026

    @umizame

    In my Codex session, it keeps reading the same files over and over, and just when it seems like it’s finally about to move on to the next task, it gets compacted again and stops.

  20. locked as resolved and limited conversation to collaborators on Jul 2, 2026
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