Context compaction repeatedly triggers in Ultra during long-running sessions

Open 💬 1 comment Opened Aug 24, 2026 by hoyrouter
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.149.1

What subscription do you have?

ChatGPT Pro

Which model were you using?

gpt-5.6-sol — Ultra/ultracode effort (almost never observed with xhigh)

What platform is your computer?

macOS 14.5 (23F79), x86_64

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

_No response_

Codex doctor report

What issue are you seeing?

Codex repeatedly performs context compaction during a long-running session. The problem is much more frequent and severe with Ultra/ultracode effort. After one compaction completes and work continues, another compaction occurs again, and this cycle repeats many times. With xhigh effort, I have almost never encountered this behavior. Each Context compacted entry in the screenshot corresponds to another compaction operation, and the repeated compactions interrupt the normal conversation flow.

What steps can reproduce the bug?

  1. Start Codex CLI 0.149.1 with gpt-5.6-sol using Ultra/ultracode effort.
  2. Open or resume a long-running interactive session.
  3. Continue the conversation until automatic context compaction is triggered.
  4. Continue working after the first compaction completes.
  5. Observe that context compaction is performed again and continues to recur, producing multiple successive Context compacted entries.

Actual result: context compaction itself runs repeatedly during the same session. This behavior is much more frequent and severe with Ultra/ultracode. Under comparable usage with xhigh, I have almost never encountered it.

This is easiest to observe in a long-running session; I do not yet have a short deterministic reproducer.

<img width="206" height="240" alt="Image" src="https://github.com/user-attachments/assets/009af38d-ca02-4d31-aadf-3819570dec0c" />

What is the expected behavior?

After automatic compaction reduces the context, the session should continue normally regardless of effort level. Ultra/ultracode should not cause compaction to repeatedly trigger again unless the context later genuinely crosses the compaction threshold. The behavior should be consistent with xhigh, where I have almost never observed this issue.

Additional information

The issue is much more pronounced with Ultra/ultracode effort; I have almost never encountered it with xhigh. The screenshot captures successive context compaction operations in the same long-running Ultra session. remote_compaction_v2 is enabled.

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 4 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #40326
  • #40213
  • #39767

Powered by Codex Action