VS Code extension should show exact in-editor change locations like Copilot, and Undo/Revert must be reliable

Open 💬 4 comments Opened Mar 21, 2026 by lfecchio
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Description

The Codex VS Code extension feels very strong in reasoning and code editing, but two parts of the editor experience still feel significantly behind GitHub Copilot:

  1. It does not clearly show, inside the editor, exactly where code was changed.
  2. Undo/Revert is not reliable enough.

Requested improvements

Please improve the VS Code extension in two areas:

1) Better in-editor visibility of edits

Codex should make it much clearer where changes happened, ideally using the native VS Code editor and diff workflow.

What would help:

  • highlight exact changed lines directly in the editor
  • show inline markers / gutter markers for modified regions
  • make it easy to jump to each change
  • clearly show which file and which function/block was changed
  • preserve a simple review flow similar to Copilot

2) Reliable Undo / Revert

Undo/Revert should be dependable and safe.

Right now, there are multiple public reports showing that undo/revert is inconsistent:

  • sometimes Undo says it succeeded, but the code is not actually reverted
  • sometimes “Failed to revert changes” appears
  • sometimes the revert flow behaves incorrectly with Git state
  • there are reports that Undo may affect staged changes in unexpected ways
  • there are also reports of revert/diff state breaking or disappearing

Why this matters

For day-to-day coding, especially in legacy codebases, the missing piece is confidence.

I need to be able to:

  • ask Codex to edit code
  • immediately see exactly where it changed things
  • quickly review the diff in the editor
  • safely undo the last Codex change if needed

Without this, the reasoning quality may be strong, but the editing workflow still feels less comfortable than Copilot.

Suggested UX direction

A Copilot-like flow would help a lot:

  • select code or ask Codex to modify a file
  • Codex applies changes
  • the changed lines are clearly highlighted in the editor
  • a native diff/review view is available immediately
  • Undo/Revert reliably restores only the Codex-generated changes
  • Git staged/unstaged state is respected and never modified unexpectedly

Example use case

I often work with C/STM32 and PHP legacy projects.
Codex can generate good edits, but I still have to manually inspect where the changes landed, and I do not fully trust Undo/Revert to safely recover from a bad edit.
A stronger in-editor diff + reliable revert workflow would make the extension much better for real daily use.

Thanks.

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 5 months ago

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

  • #15241
  • #14210
  • #13721

Powered by Codex Action

molon · 5 months ago

+1 on both points. I built a VSCode extension that highlights changes inline (green for additions, red insets for deletions) with per-hunk Accept/Discard. It tracks baselines independently so undo is always reliable regardless of git staging state. Works with Codex and any other CLI tool.

Uses VSCode's proposed editorInsets API so it's not on the marketplace — needs manual VSIX install.

https://github.com/molon/hunkwise

<img width="2338" height="2054" alt="Image" src="https://github.com/user-attachments/assets/5b1b77ed-3759-45af-89b1-811132d7fe4c" />

switchi-i · 4 months ago

Additional concrete reproduction / UX gap from real VS Code usage on Windows:

I tested Codex editing with multiple sequential file modifications in the same session, and the current recovery story still feels unsafe.

What happens in practice:

  • Codex often applies a change as multiple editor operations/patch steps rather than one atomic edit.
  • VS Code Ctrl+Z only undoes the most recent editor step, not the whole AI change request.
  • As a result, a single Codex request may require several manual undo operations, and there is no reliable “undo the whole last AI edit” behavior.
  • Codex’s own Undo/Revert is not trustworthy enough to depend on as the primary safety mechanism.
  • git restore <file> is too coarse because it restores the whole file to the last Git state, which also removes earlier good AI edits in that file.

A particularly painful workflow is:

  1. Codex edits the same file multiple times.
  2. I like the earlier AI edit but dislike the latest one.
  3. Ctrl+Z only walks back one internal step at a time.
  4. git restore removes both the bad latest edit and the earlier good edit.

So the missing capability is not just “undo exists”, but:

  • request-level atomic undo
  • or automatic lightweight checkpoints before each Codex-applied change batch
  • or a review/apply flow where edits are approved before landing in the file

Without one of those, the current default behavior (apply code directly) creates too much risk for normal iterative editing.

In short: editor undo is too granular, Git restore is too coarse, and Codex revert is not reliable enough. The extension really needs a safe middle layer for request-scoped rollback.

me9hanics · 2 months ago

As I experience using Codex in VSC, this still seems to be not possible. The line diff view that GitHub Copilot provides is desired.