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?

  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_

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 2 months ago

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

  • #18720

Powered by Codex Action

zaptrem · 2 months ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. * Codex auto-compact loses critical task details and causes wrong execution, even on small fixes #18720 _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.

mahdikayvan · 2 months ago

@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.

Cheers,
Mads.

runfence · 2 months ago

Same on Windows IN CLI

XQDEBUG · 2 months ago

Fuck Codex!!!!!

VerTiGoEtrex · 2 months ago

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 /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).

zilleste · 7 days ago

It seems like this issue was fixed during some recent release! At least it doesn't happen for me anymore