codex icon indicating copy to clipboard operation
codex copied to clipboard

Code and context rollback

Open moos1110 opened this issue 1 year ago • 4 comments

The Codex terminal version lacks the ability to roll back code and context. When a generation goes wrong or the context becomes polluted, there is no way to quickly restore a stable state. This breaks the interactive workflow for writing and correcting code, making the terminal version practically unusable for real development.

Expected Behavior Code rollback: Quickly switch to a previous code snapshot within the terminal session.
Context rollback: Restore to a specific conversation node to avoid error propagation.
Simple trigger: By pressing Esc twice, an interactive menu should appear, allowing the user to choose:
Roll back to a specific context node
Roll back to a specific code snapshot
Compare differences between versions

Current Behavior No built‑in rollback mechanism.
Once an error is generated, the only option is manual copy/paste or starting over.
Context pollution accumulates and cannot be cleaned.
Iteration and review are inefficient.

Impact Development efficiency drops: Stable iteration and branching experiments are impossible.
Risk increases: Once wrong code or prompts enter the context, they persist.
Not aligned with CLI workflows: Terminal users expect reversible, auditable operations.

Suggested Solution Shortcut trigger: Double‑press Esc → open rollback selection menu.
Interactive choice: User selects which context or code snapshot to revert to.
Command fallback: Keep CLI commands like codex revert for advanced users, but Esc Esc provides a fast entry point.
Snapshot storage: Save snapshots in .codex/ directory, with optional tags for management.

Steps to Reproduce

  1. Start a multi‑round coding session in the terminal.
  2. Generate an incorrect output.
  3. Attempt to restore the previous correct version.
  4. Observe: rollback is impossible, only manual workarounds exist.

Environment Systems: Linux / WSL / Termux / Windows PowerShell
Version: Latest stable terminal release of Codex
Project type: Multi‑file project requiring consistent context

moos1110 avatar Nov 10 '25 08:11 moos1110

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

  • #4524
  • #5333
  • #5006
  • #4690
  • #6074

Powered by Codex Action

github-actions[bot] avatar Nov 10 '25 08:11 github-actions[bot]

I think these steps to reproduce are too general. I've been doing this countless times and never had a problem getting codex cli to rollback it's changes... Can you make them more specific? perhaps a code example and a specific broken change?

ZackHirshhorn avatar Nov 10 '25 13:11 ZackHirshhorn

This feature request hasn't received enough upvotes to keep open. There are other similar feature requests, so feel free to upvote those.

etraut-openai avatar Jan 17 '26 05:01 etraut-openai

Needed

lly-ke avatar Mar 24 '26 03:03 lly-ke