
Editing the prompt after sending it: what happens to everything that came after
Editing a sent prompt re-sends it and discards or branches what followed. How to design the edit so people understand what changes and what gets lost.
What changes when you edit?
Editing is not fixing one word. When you resend an edited message, the conversation goes back to that point and generates a new response. Everything that came after depends on the previous version, so it is now out of date.
The usual implementation, which the assistant-ui documentation describes for its chat components, works like this: editing re-submits a message from an earlier point in the conversation and creates a new branch. When you send from the editor, the later messages are dropped from that path and the assistant generates a new response from the edited point.
Behind that single gesture sit different intents. Tian Pan names three: course correction, exploring an alternative and rolling back to a fork point. In his words, most products default to discarding what came after, because keeping it creates a navigation problem a linear chat cannot represent. One sign that branching is needed is people who edit a message and then rebuild the lost version by hand.
If what you want is another answer without touching the question, that is regenerating, not editing. Editing changes the question; regenerating changes only the answer.
For the person using the tool, the difference between “rewriting” and “branching” matters. If the system rewrites, the original version disappears and there is no way back. If it branches, the person can compare and recover what was dropped.
Why does it matter to a designer?
Because editing has three moments the interface must show:
- Before sending. Whoever edits must see that the original text is available to cancel without changes.
- When resending. It should be clear that what follows will be regenerated, and whether anything will be lost.
- Afterwards. The conversation should show which version is active and where the previous one is.
A common mistake is hiding the second moment. The person edits a message from ten turns earlier without knowing they are discarding nine responses. When they notice, they feel the tool took away their work.
What happens with the model?
One point few interfaces explain: the model can only answer well with what it receives. If the backend stores the original and the edited version as two consecutive turns, the model sees both and may answer one the person already discarded. That is why editing also affects the conversation history: what the person sees as a list must match what the model receives.
A recent analysis of chat architecture describes exactly this problem. According to the article, when the backend stores the conversation as an append-only log, each edit is appended as a new version (message.v2 next to message.v1), and the model receives the original message, its reply, the correction and the new request. The symptoms are edits that don’t take, because the agent keeps citing the original value, and replies that anchor on a response that was already discarded. The superseded content also keeps adding tokens on every call. The fix it proposes is to store messages as nodes with a parent pointer, so an edit becomes an active sibling of the original and only the active path is sent to the model. A lighter alternative is to keep both turns and tell the model explicitly which one supersedes the other. This case makes clear that the design of editing is also a data design.
How do you design the edit?
- Edit in place. Editing in the same spot, with the text already loaded in a field, is usually smoother than opening a separate form.
- Allow cancelling without resending. A cancel button that restores the original text prevents accidental edits. In assistant-ui, for example, cancelling exits edit mode and restores the content without resending.
- Say what gets discarded. If there are later responses, a brief notice says how many will be regenerated. It does not need a large alert.
- Keep the previous version as a branch. That way the person can return if the new response does not work. An inline indicator like “1/3” with arrows to switch branches works well with a few branches; with many, a tree panel is better. This relates to conversation branching.
- Block it while the model is responding. If the AI is generating, editing and resending creates states nobody can follow. Opening the editor does not stop the response in progress (that is how assistant-ui behaves), so blocking editing or sending while the assistant responds is your decision: show the editor, but disable sending or ask to cancel first.
A minor edit, such as fixing a typo, should not regenerate the whole conversation. If the system can tell a correction from a change of question, that difference saves time and tokens. If it cannot, leave the choice to the person.
Example
Illustrative example: a person asks an assistant for an interview plan for a project. After ten messages, they realize they wrote “users aged 40” and meant “users aged 14”. They edit the first message.
The interface shows: “Resending will regenerate 9 responses. The previous version stays available as a branch”. The person confirms. The new plan appears with a counter “1 of 2” at the top. If they want the original, one arrow takes them back. The edit costs one click, and the person knows what they gave up.
Without the notice, the same person would have thought the assistant ignored the correction and asked for the plan again.
When should you NOT allow editing?
When the conversation depends on actions that have already run, such as a sent order or a created file, editing the message does not undo those actions. In those cases, the interface must say what is still in effect and what is not. And in tools where the conversation is a legal or audit record, the edit must be logged, not replaced.
Before shipping it
Before you publish an edit flow, test three cases in the tool, not in your head:
- Edit the first message of a long conversation and check that the notice about regenerated responses shows the right number.
- Cancel an edit and check that the original text comes back without sending anything.
- Try to edit while the response is still being written, and confirm that sending is blocked or that the action is cancelled explicitly.
If any of these cases leaves the person not knowing what happened, the edit is not ready, even if the main flow works.
Common mistakes
- Rewriting the message without keeping the previous version.
- Sending the model both the original and the edited version.
- Allowing edits while the response is still being generated.
- Not saying how many later responses will be regenerated.
- Using edit to fix typos and regenerating everything for a minor change.