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
[Codex CLI] Old context persists when forking then jumping back to a previous message in the history #21986
What terminal emulator and version are you using (if applicable)?
Ghostty 1.3.1 (latest)
What issue are you seeing?
I forked an active session into a new Ghostty terminal pane. To remove unnecessary recent context, I pressed Escape twice to navigate back to a much earlier message in the history. I then pressed Enter, typed my new prompt, and sent it.
Expected Behavior: Reverting to an earlier point in the chat should drop all subsequent messages, giving me clean context from that specific point onward.
Actual Behavior: The CLI failed to truncate the history. My new message still included all the later conversation context that should have been removed when navigating backward. See the last 2 messages that the agent sent to see how I figured out the agent still had context. I have attached the chat logs for reference so you can review the incorrectly retained context.
What steps can reproduce the bug?
Uploaded thread: 019e0f32-c82
What is the expected behavior?
All of the messages and replies that came after the message I reverted to should be removed from the agent's context.
Additional information
No response
Reacted by João Pedro Nimuendaju , VerTiGoEtrex and mdawid
changed the title [-][Codex CLI] Reverting to an early point after forking keeps removed messages in the context[/-][+][Codex CLI] Old context persists when forking then jumping back to a previous message in the history[/+]on May 10, 2026
Thanks for the report! I verified on macOS with Codex CLI 0.171.0 that rewinding in a fork removes the selected prompt and all later turns from the model’s context. I checked both the replacement request and the follow-up. Closing as fixed.
If you’re returning to a session created on 0.130.0 and see thread/revert only supports paginated threads, close the parent session, run codex migrate-rollouts --apply --thread <parent-thread-id>, then fork it again. I verified that rewinding works after migration.
Activity
github-actions commentedon May 10, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-][Codex CLI] Reverting to an early point after forking keeps removed messages in the context[/-][+][Codex CLI] Old context persists when forking then jumping back to a previous message in the history[/+]etraut-openai commentedon Nov 21, 2026
(response from codex)
Thanks for the report! I verified on macOS with Codex CLI 0.171.0 that rewinding in a fork removes the selected prompt and all later turns from the model’s context. I checked both the replacement request and the follow-up. Closing as fixed.
If you’re returning to a session created on 0.130.0 and see
thread/revert only supports paginated threads, close the parent session, runcodex migrate-rollouts --apply --thread <parent-thread-id>, then fork it again. I verified that rewinding works after migration.