Edit past messages

Open 💬 20 comments Opened Aug 30, 2025 by archodev
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

It would be nice if past messages could be edited, this would be useful if you make a typo or forgot to add a detail to a message. Specifically for the IDE extension, this would pair nicely with automatically undoing all the way back to where the message you edited is as the undo functionality is already built

View original on GitHub ↗

20 Comments

jmpaz · 10 months ago

This would indeed pair nicely with the recent implementation in the CLI. It would be wonderful if the edit/regen-tree was navigable as well (in both IDE + CLI) bringing the currently-rudimentary branching support up to par with ChatGPT:

<img width="492" height="227" alt="Image" src="https://github.com/user-attachments/assets/00af8271-b28b-4939-bcf1-c2834f5ba00a" />

relevant comment: https://github.com/openai/codex/pull/2898#issuecomment-3237244645

kargarisaac · 9 months ago

+1

hamzaq2000 · 8 months ago

In Codex CLI, you can press Esc twice to edit messages. Keep hitting it to go up messages, and then Enter to edit.

LinFei83 · 7 months ago

I also need this function

csaftoiu · 6 months ago

+1, specifically for wanting to go back and 'restore' a prev conv tree and take it in new direction

jmpaz · 6 months ago
It would be wonderful if the edit/regen-tree was navigable as well (in both IDE + CLI) bringing the currently-rudimentary branching support up to par with ChatGPT

Claude Code, for example, has --fork-session, but the user experience is detached from the chat UI / not very fluid or intuitive. I personally don't find slash commands (eg /fork, along the lines of /undo) to be a great approach to this either.

Amp's message editing + forking UX, on the other hand, is on par with ChatGPT web:

<img width="1057" height="413" alt="Image" src="https://github.com/user-attachments/assets/7a211d86-9914-43ce-a8fe-3f0bba0dda05" />

Edit states + forked messages can be returned to by the user at any time, with a spatial thread map for navigation:

https://github.com/user-attachments/assets/ffa57a64-66c4-4fd3-b07c-eecaffc0d62d

(video source)

maribox · 6 months ago
with a spatial thread map for navigation

I once searched for a tool like that a year ago and agree that would be a really really cool and useful addition to the Codex extension!

matthiaswitt · 6 months ago

+1

J3m5 · 6 months ago

message edit is currently broken in the CLI
When hitting ESC then Return on the message to edit, it starts a fresh session
It might be caused by the usage of the /review command in the session where it happens

etraut-openai contributor · 6 months ago

@J3m5, if you think you're seeing a bug, please open a new bug report. This thread is discussing a new feature request.

kt-devoss · 5 months ago

+1
Keeping accidentally sent past prompts in the thread isn’t just a UX issue—it can degrade model performance, and it can keep Codex from reaching its full potential (_which is unfortunate_), for example:

  • Incorrect information persists in the dialogue history and misleads subsequent reasoning. (Context contamination / False-premise propagation)
  • Even after an explicit correction is appended, the original and corrected statements coexist, preventing a uniquely determined final specification. (Specification ambiguity / Conflicting specifications)
  • As corrections and addenda accumulate, the relative salience of key constraints attenuates, increasing the likelihood of constraint mix-ups. (Constraint dilution / Instruction salience degradation)
  • As the session length grows, the noise-to-signal ratio increases, degrading consistency and reproducibility. (Context drift / Reliability degradation)

Also, not only for mistakes: when parts of the thread are no longer needed, being able to go back to an earlier point and keep the conversation clean would help the LLM use its capabilities more effectively.

Therefore, the ability to _edit past messages_ and _branch conversations_ is essential.
I’m really looking forward to this—hope we can get it in soon!

kt-devoss · 5 months ago

The thread seems to mix two topics (“editing” vs “branching”), so here’s a possible breakdown:

A) Edit last message: quick undo for typos / accidental prompts.
B) Edit older message: rewrite/remove stale content and keep a single clean canonical thread.
C) Branch: fork from an earlier point and continue with an alternative direction.

Capability-wise, C can cover many A/B use-cases by forking from the last correct state (C ⊇ B ⊇ A).
But UX-wise they’re different: editing keeps one canonical thread clean, while branching preserves history and starts a new path. Having both (even a minimal A + C) would address most of the performance/quality issues discussed above.

I often send messages by mistake, so I’d like A as soon as possible.

I also want C. Sometimes I need to explore multiple approaches in parallel, and without branching, Codex tends to be influenced by ideas I’ve already abandoned. Because of that, I reluctantly switch to the ChatGPT web UI (which supports branching and editing) and copy-pasting the discussion back and forth as a workaround (tedious ...).

kt-devoss · 5 months ago

@etraut-openai ,maintainers,
this thread is titled “Edit past messages,” but the discussion is also expanding into conversation branching(C).
Should we keep this together (broaden scope/title), or track branching in a separate canonical issue?

My guess is they share the same underlying foundation, but from a UX perspective they’re different, and the implementation timeline may differ as well.

One concern: if we bundle A/B/C too tightly, it might delay A, which would be immediately helpful for many of us. Even if we keep the discussion unified, it may still make sense to ship A first and treat branching (C) as a follow-up on its own timeline.

BorisMolch · 5 months ago

+1

BorisMolch · 5 months ago

isn't this trivial to implement ?
Is this a business decision to drain token usage , to not implement this?

BorisMolch · 5 months ago
In Codex CLI, you can press Esc twice to edit messages. Keep hitting it to go up messages, and then Enter to edit.

oh i missed this . somehow hard to use

lizn33 · 5 months ago

+1

lizn33 · 5 months ago

Even Gemini Code Assisent has this function

notOrrytrout · 3 months ago

You can edit in the MacOS app if you are using ollama. 🤷‍♂️just not with open ai.

notOrrytrout · 3 months ago

Editing my past messages now seems to work perfectly using open AI models. Also for ollama models so this should be closed. At least for the Mac app.