codex icon indicating copy to clipboard operation
codex copied to clipboard

Edit past messages

Open archodev opened this issue 1 year ago • 22 comments

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

archodev avatar Aug 30 '25 14:08 archodev

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:

Image

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

jmpaz avatar Aug 30 '25 14:08 jmpaz

+1

kargarisaac avatar Oct 23 '25 19:10 kargarisaac

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

hamzaq2000 avatar Nov 19 '25 07:11 hamzaq2000

I also need this function

LinFei83 avatar Dec 22 '25 09:12 LinFei83

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

csaftoiu avatar Dec 27 '25 21:12 csaftoiu

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:

Image

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)

jmpaz avatar Dec 29 '25 14:12 jmpaz

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!

maribox avatar Jan 04 '26 23:01 maribox

+1

matthiaswitt avatar Jan 06 '26 18:01 matthiaswitt

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

J3m5 avatar Jan 07 '26 15:01 J3m5

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

etraut-openai avatar Jan 07 '26 16:01 etraut-openai

+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 avatar Feb 11 '26 10:02 kt-devoss

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 avatar Feb 11 '26 12:02 kt-devoss

@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.

kt-devoss avatar Feb 11 '26 12:02 kt-devoss

+1

BorisMolch avatar Feb 16 '26 12:02 BorisMolch

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

BorisMolch avatar Feb 16 '26 12:02 BorisMolch

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

BorisMolch avatar Feb 16 '26 12:02 BorisMolch

+1

lizn33 avatar Feb 18 '26 17:02 lizn33

Even Gemini Code Assisent has this function

lizn33 avatar Feb 18 '26 17:02 lizn33

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

notOrrytrout avatar Apr 01 '26 04:04 notOrrytrout

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.

notOrrytrout avatar Apr 01 '26 23:04 notOrrytrout