You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
All context is lost upon editing message from before compaction #20287
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:
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
Reacted by runfence, VerTiGoEtrex, agents0592 and logitprop
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:
tell the agent to remember-progress or remember-this when something important should not be lost
use consult-brain when the current task needs more grounded feedback on what to do next
Over 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.
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.
A workaround I'm considering is /fork but I'm not sure it works as intended yet, and it requires a lot of foresight whereas using ESC to rollback is done post-hoc. IIRC, /resume may clear significant parts of the context window as well due to trying to avoid cache misses (or at least that's what claude does).
Activity
github-actions commentedon Apr 29, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
zaptrem commentedon Apr 30, 2026
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.
mahdikayvan commentedon May 10, 2026
@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.
runfence commentedon May 13, 2026
Same on Windows IN CLI
XQDEBUG commentedon May 15, 2026
Fuck Codex!!!!!
VerTiGoEtrex commentedon May 20, 2026
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.
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).logitprop commentedon Jul 13, 2026
It seems like this issue was fixed during some recent release! At least it doesn't happen for me anymore