All context is lost upon editing message from before compaction
Open 💬 7 comments Opened Apr 29, 2026 by zaptrem
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
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?
- Run a conversation to the point where the next chat message immediately causes a compaction
- Allow compaction to happen and a response to be written
- Edit the prior message to ask about prior conversation history.
- Codex will not remember anything from the prior conversation
- 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_
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The above post does not appear to be a duplicate. They complain about likely model performance issues (i.e., compaction missing details). My post posits that all context is lost upon executing this set of actions.
@zaptrem Hey — I feel this pain too. Your issue is very close to the reliability problem I’m working on.
I’m building AgaveCore, and I’d like to let a few early people use it for free while I shape it into something stronger.
It helps when a coding agent starts to drift, loses important context, or gives you an output you do not fully trust.
In practice, it works through two habits:
remember-progressorremember-thiswhen something important should not be lostconsult-brainwhen the current task needs more grounded feedback on what to do nextOver time, as useful journals, decisions, and failures pile up, the product should help the agent make sharper decisions and take better actions with less drift.
If this sounds relevant, reply here and I’ll send the exact steps. You can also use the email or Telegram on my profile.
Cheers,
Mads.
Same on Windows IN CLI
Fuck Codex!!!!!
This is a pretty significant problem for me too. I edit previous messages all the time, but I can actually end up in a worse state by doing this which is obviously not the intended behavior.
Here's an example of a chat I rolled back after some tangents that ended up with 0% context (shows 1% due to my question about context). I had to start again completely from scratch.
<img width="1328" height="435" alt="Image" src="https://github.com/user-attachments/assets/a1c97647-cfdb-4e05-80da-7c4d33faac0f" />
A workaround I'm considering is
/forkbut I'm not sure it works as intended yet, and it requires a lot of foresight whereas usingESCto rollback is done post-hoc. IIRC,/resumemay clear significant parts of the context window as well due to trying to avoid cache misses (or at least that's what claude does).It seems like this issue was fixed during some recent release! At least it doesn't happen for me anymore