Problem What problem does this solve? During a single chat session, users often make multiple consecutive requests, resulting in a series of successful code changes. However, if the final request leads the AI down the wrong path and generates incorrect code, there is no easy way to undo just that last step. Currently, users are forced to either manually fix the code in the editor to save the previous successful steps, argue with the AI to fix its mistake, or start a completely new chat (which loses all the valuable context and previous successful modifications).
Solution How should it work? Introduce a sequential “Revert” or “Step Back” button. This feature should work hierarchically. Clicking it should undo only the latest user prompt, the latest AI response, and crucially, revert the code changes applied during that specific last step. The user should be able to click it multiple times to step backward through the chat history sequentially. This ensures the chat context and the file state return exactly to the point before the reverted request, preserving all prior successful work.
Use Case When would you use this? Imagine I make 5 consecutive requests in a single chat. The AI successfully understands and modifies the code for the first 4 requests. However, the 5th request results in flawed logic and breaks the code. Instead of manually undoing the 5th change in the editor or restarting the chat, I simply click the “Revert” button once. The 5th prompt, its response, and its specific code changes are undone, while the successful code from the first 4 requests remains perfectly intact. I can then write a better prompt for the 5th step and continue seamlessly.
Priority
Medium - Important improvement (Note: This drastically improves developer workflow, prevents context pollution, and saves the user from losing progressive code changes).
Additional Info
- The rollback must be synchronized: reverting a chat step must also revert the active file’s code to the exact state it was in at that specific moment in the chat history.