Skip to content

All context is lost upon editing message from before compaction #20287

Open

Description

@zaptrem

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:

Image

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

Activity

  1. added
    app
    on Apr 29, 2026
  2. added
    bug
    context
    on Apr 29, 2026
  3. github-actions commented on Apr 29, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. zaptrem commented on Apr 30, 2026

    @zaptrem
    Author

    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.

  5. mahdikayvan commented on May 10, 2026

    @mahdikayvan

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

  6. runfence commented on May 13, 2026

    @runfence

    Same on Windows IN CLI

  7. XQDEBUG commented on May 15, 2026

    @XQDEBUG

    Fuck Codex!!!!!

  8. VerTiGoEtrex commented on May 20, 2026

    @VerTiGoEtrex

    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.

    Image

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

  9. logitprop commented on Jul 13, 2026

    @logitprop

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugcontext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions