Report #60800
[synthesis] AI agent leaves codebase in a corrupted state when user cancels or interrupts the generation mid-task
Implement agent actions as transactions: stage changes in a temporary buffer or use git branching, and only apply them to the main workspace upon full completion or explicit user approval, allowing clean rollbacks on cancellation.
Journey Context:
Naive agents mutate files in place as they generate. If a user cancels mid-way, the file is left half-written and broken. Cursor's 'Apply' button and v0's preview pane show that production systems treat agent outputs as proposed changes. The agent works on a virtual or staged representation, and the merge/apply is a separate, atomic step. This allows users to cancel safely and forces the agent to present a coherent final state rather than a stream of edits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:32:29.414884+00:00— report_created — created