Undo does not work
What version of the VS Code extension are you using?
0.4.6
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
- Ask codex in full agent mode to make a change to file
- It makes a change a shows a diff window in chat
- Click Undo at the top of the diff window
- Green notification comes up showing changes reverted message but changes are not reverted in the file
What is the expected behavior?
The changes shown in the diff window that were applied to file should be undone/reverted.
What do you see instead?
The green message box with "Changes reverted" but the file still shows the updated content that was not reverted. Opening closing file does not make a difference.
Additional information
Tried several times between software restarts - the same issue persists. Agent does not offer any insight or report any issue, says its a bug in the UI and offered to revert the changes himself.
+1 even on pre-released version 0.58 still doesn't work
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
Im having a similar issue on version 0.4.10 of the vscode extension using gpt-5 codex. But when i click 'undo' i get a red pop-up messages that says "Failed to revert changes". And the diff window remains open with the changes in it;
@josh000111 Is your code in a git repo?
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
Currently I'm on 0.5.11 pre-release version, the behavior is different here, on git repo it shows green toast and if I check on file it worked, but on non git repo it shows red toast
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
Currently I'm on 0.5.11 pre-release version, the behavior is different here, on git repo it shows green toast and if I check on file it worked, but on non git repo it shows red toast
Thats happen on gpt-5 model, but now I use model gpt-5-codex and it seems undo and changes feature not implement yet
The diff view you're on won't update if you click revert but should check the underlying file. Can you confirm if that works?
@setyanzxc123 are you seeing the green toast or is it red?
For both of you, is your code in a git repo?
Locally hosted code. Opened the file itself to check not just diff and no changes are not reverted. The toast is green.
This happened to me too, except something even more bizarre happened where I tried to undo, first time it didn't work, and then later I noticed at some point it had staged a change. Also one of the files I was working with wasn't saving and I couldn't figure wait why, and suddenly VSCode showed an error that a file has been changed since I opened it.
All very bizarre because usually any LLM coding agent I've used (including codex CLI, at least as of a few weeks ago) just makes changes to the local source which shows up instantly in all open files AND in source control.
I'm hearing two separate things here:
- Undo not working outside of a git repo. We're working on improvements to that so stay tuned.
- Apply and undo behaving in unexpected ways when you have an open editor for that file, especially if it has unsaved changes of its own. The underlying issue here is that the extension uses the Codex CLI (this repo) to make changes rather than going through the editor. We'll also explore some options here. I think we can do better than we are today. For now, if the x on your tab is a circle and you think Codex may have touched that file, close the tab and discard your changes so it can pick up the filesystem changes.
@gpeal I was working within my git repo on Vscode, plugin was in local mode, and undo wasn't working.
Regarding your second point, i was using the Codex CLI for a few weeks before this latest new model and plugin setup, and I never had this issue... I always saw my files updated in realtime as Codex worked on them, and I never had the CLI try to stage anything.
@maxiedaniels At the moment, undo works by:
- Staging the files it needs to revert
- Using git to revert the files
We're going to be exploring some changes to revert that will hopefully remove this though. Fingers crossed.
Same issue here +1
Same issue here.
My code is from a github repo.
Asking it to undo the changes will do the same thing @gpeal said.
i’m experiencing the same issue with codex extension 0.4.21 - when clicking undo, i get a confirmation, but the changes aren’t actually reverted.
it would be extremely helpful to: 1) fix this issue and 2) add an option like “revert to this point in conversation” or “discard all changes up to this checkpoint,” with the ability to reapply changes if needed.
other ai code editors include this feature, and it’s made a huge difference in usability.
@tibo-openai sorry for the ping, but i think this would really improve ux and productivity in general
Still not working here, should we use the pre release version for that ?
Still not working here. Very bad!
Still not working here. Very bad!
I noticed that if I use github to do version control for the project, it works. I think that's great, but openai seemed not clearly tell their users that the Undo function depends on Git.
Here are suggestions to the developers of OpenAI Codex Plugins in VSCode:
- Remove Undo, and give annother choice: change between different version. Add 2 buttons, one for the past version, one for the future version. Believe me, this makes Codex cooler!
- Support all official commands, especially
/compact!