Bug Report: Destructive Restore/Undo Behavior

Bug Report: Destructive Restore/Undo Behavior

Title: “Confirm Undo” functionality deletes files instead of restoring previous content state.

Description: When using the “Restore” icon (circular arrow) on a previous conversation turn, the platform prompts to “Delete” files that were modified or created in subsequent turns. This behavior is destructive and leads to permanent data loss of the work performed after that checkpoint, rather than simply reverting the file content to its state at that specific point in time.

Steps to Reproduce:

  1. Initiate a conversation and have the agent create or modify several files (e.g.,

    About.tsx).

  2. Navigate back to an earlier message in the conversation history.

  3. Click the “Restore” (Undo) icon on that message.

  4. Observe the “Confirm Undo” dialog.

Actual Behavior: The dialog shows “Delete” for files that were touched in later turns. If confirmed, the files are removed from the workspace entirely.

Expected Behavior: The platform should snapshot the state of the workspace at every turn. Clicking “Restore” should:

  1. Perform a “rollback” of the file contents to exactly how they were at that specific turn.

  2. Show a “Diff” of content changes (Additions/Deletions within the file) rather than a file-level “Delete” operation.

  3. Preserve the file existence if it existed at that point, just with the older content.

Impact: High. This results in unintended data loss and makes the “Restore” feature dangerous to use during active development.

Suggestions for the developers:

  • Implement a content-based snapshotting system.

  • Change the “Confirm Undo” UI to show a file comparison (diff) so users know exactly what content is being reverted.

  • Ensure that “Undo” only removes a file if that file truly did not exist at the target restoration point.