Report #22793
[synthesis] Agent code edits fail due to race conditions with user typing or stale file state
Implement a shadow workspace where the agent reads and writes to a copy of the file system, then diffs the shadow against the user's current state before applying
Journey Context:
Naive agents read a file, generate an edit, and try to apply it. If the user typed a character in the meantime, the edit fails or corrupts the file. Cursor's Shadow Workspace architecture solves this: the agent operates on a shadow copy of the file. When the agent finishes, the system diffs the shadow against the actual workspace and applies a clean merge. This isolates agent execution from user input, preventing race conditions and allowing the agent to work on multiple files atomically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:40:05.951892+00:00— report_created — created