codex - ✅(Solved) Fix Multiple context compactions happening at the same time [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17514Fetched 2026-04-12 13:27:17
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2unlabeled ×1

PR fix notes

PR #17601: Suppress duplicate compaction and terminal wait events

Description (problem / solution / changelog)

Addresses #17514

Problem: PR #16966 made the TUI render the deprecated context-compaction notification, while v2 could also receive legacy unified-exec interaction items alongside terminal-interaction notifications, causing duplicate "Context compacted" and "Waited for background terminal" messages.

Solution: Suppress deprecated context-compaction notifications and legacy unified-exec interaction command items from the app-server v2 projection, and render canonical context-compaction items through the existing TUI info-event path.

Changed files

  • codex-rs/app-server/src/bespoke_event_handling.rs (modified, +27/-0)
  • codex-rs/tui/src/chatwidget.rs (modified, +2/-1)

Code Example

Context compacted

Context compacted
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.120.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)?

iTerm

What issue are you seeing?

• Context compacted

• Context compacted

I see this every time the context auto compacts. Two compactions oddly.

What steps can reproduce the bug?

Just let it auto compact.

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

The issue of seeing "Context compacted" twice during auto compaction in Codex CLI version 0.120.0 may be related to a bug or unexpected behavior in the compaction process.

Guidance

  • Verify if this issue persists across different models, such as trying with a different model version like gpt-5.3 or gpt-5.5, to isolate if the problem is model-specific.
  • Check if there are any known issues or updates related to context compaction in the Codex CLI version 0.120.0 documentation or release notes.
  • Attempt to manually compact the context to see if the issue is specific to auto compaction or if it occurs with manual compaction as well.
  • Consider reporting this issue to the Codex CLI support or community forums for further assistance, as the provided information does not yield a straightforward solution.

Notes

The provided information does not specify the expected behavior during context compaction, making it challenging to determine the root cause or provide a definitive fix. The issue might be specific to the combination of the Codex CLI version, the gpt-5.4 model, and the macOS platform.

Recommendation

Apply workaround: Since the issue seems to be related to the auto compaction feature, a temporary workaround could be to disable auto compaction and compact the context manually when necessary, although this does not address the root cause and may not be ideal for all use cases.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING