codex - 💡(How to fix) Fix All context is lost upon editing message from before compaction [2 comments, 2 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#20287Fetched 2026-04-30 06:30:39
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×2
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.422.71525 (2210)

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.3.0 arm64 arm

What issue are you seeing?

If you edit a pre-compaction message after compaction, Codex will lose chat state. See screenshot

What steps can reproduce the bug?

  1. Run a conversation to the point where the next chat message immediately causes a compaction
  2. Allow compaction to happen and a response to be written
  3. Edit the prior message to ask about prior conversation history.
  4. Codex will not remember anything from the prior conversation
  5. Attempts to fork at prior messages causes the same behavior (Codex does not remember any conversation context when asked in forked versions of the conversation)

See here:

<img width="1058" height="1040" alt="Image" src="https://github.com/user-attachments/assets/77f6c44f-4719-48e4-ae1f-39942abe8241" />

What is the expected behavior?

Compaction runs again with the new message, or Codex recalls pre-compaction context some other way.

Additional information

No response

extent analysis

TL;DR

Editing a pre-compaction message after compaction causes Codex to lose chat state, and a potential fix involves re-running compaction with the new message or finding an alternative way for Codex to recall pre-compaction context.

Guidance

  • Verify that the issue is specific to editing pre-compaction messages and not a general issue with conversation history by testing with different message edits and compaction scenarios.
  • Attempt to reproduce the issue with different conversation flows to see if the problem persists across various chat states.
  • Consider testing if manually triggering compaction again after editing the message resolves the issue or if there's an option to recall pre-compaction context in another way.
  • Review the conversation history management in Codex to understand how it handles compaction and edits to pre-compaction messages.

Example

No specific code example can be provided without more details on the Codex App's internal workings or APIs.

Notes

The solution may depend on the internal implementation of the Codex App, particularly how it manages conversation state and compaction. Without access to the app's code or documentation, the guidance is limited to exploring the app's behavior and potential workarounds.

Recommendation

Apply workaround: Given the information, a workaround such as re-triggering compaction or finding an alternative method for Codex to recall pre-compaction context after editing messages might be necessary until a more permanent fix is available.

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

codex - 💡(How to fix) Fix All context is lost upon editing message from before compaction [2 comments, 2 participants]