Canvas editing is broken, please fix, November edition

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Canvas tools make changes then the canvas is reverted.

Steps to Reproduce

While canvas is opened, ask for changes to it. It’s borked or reverted when the chat stops.

Expected Behavior

Changes should remain.

Operating System

Other

Version Information

Version: 3.28.5
VS Code Extension API: 1.128.0
Commit: 18b4e7e5fb7fc450d7797e36c596c31aedaf59f0
Date: 2026-10-28T06:35:30.580Z
Layout: IDE
Build Type: Stable
Release Track: Nightly
Electron: 42.11.16
Chromium: 148.0.7778.280
Node.js: 24.19.0
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Linux x64 6.8.0-139-generic

Additional Information

You added this feature then broke it. Either fix it or remove so at least there is no frustration.

Does this stop you from using Cursor

Yes - Cursor is unusable

Hi @vibe-qa, when this happens, try closing the canvas tab and opening it again from the chat. If the open tab is just stuck on an older render, the reopened tab should show the agent’s changes.

Could you let me know which one you see after reopening: the changes, or the old version of the canvas? That tells us whether the file itself is being reverted or only the view, and they’re two different fixes.

We are tracking an issue in which open canvases retain stale content after the agent edits them.

Sometimes the changes start foo fast, or I switch to another agent view, or IDE tab. I can’t start closing all the canvases involved just in case an agent might change one of them, and then scroll and start opening them back one by one to continue the work.

I don’t understand how a view-only canvas frame can enforce rollback or old version saving, OVER the agent’s work. The whole point of using canvases is to see live progressive updates while the agent works, otherwise I would just make HTML files and bother myself more, but know that the logic is sound.

I will never edit a canvas manually. Why is this even an option provided? Just make it forever read-only.

AH HA! The file on disk reverted the JSX that inserts PeriodHeatmap into the page!

PeriodHeatmap exists but is never rendered.

The default export is the old page without the heatmap. The plot likely disappeared because a later edit or canvas sync restored the old function body, removing from the tree.

Patch 3 inserted the PeriodHeatmap function but did not touch the default export. The render insertion was likely reverted by a later edit.

Patch 4 was also reverted. It inserted PeriodHeatmap into the page and passed typecheck, but now the file shows the old intro text with no heatmap usage. Patches 5 and 6 are gone too; the current file still has the old caption and the original five-stop color scale.

The canvas host likely reverted the file to a state after the heatmap function was added but before it was inserted into the render tree.

The canvas IDE likely saved an older buffer over the newer edits. The self-refresh then dropped the node from the render tree.

The plot was visible before the refresh. The canvas likely compiled and wrote back a transformed file that dropped the JSX changes.

I actually had it closed. Then opened after the agent finished, and it showed the changes for less then a second then wiped changes back to previous version. The canvas file was not visible, not open anywhere.

Hi @vibe-qa, since the file on disk is going back to an older version, this isn’t the stale view I mentioned, so closing and reopening the tab won’t help here. I’ve passed it to the team as its own issue, since it means the agent’s work is being lost.

One thing to check in the meantime: open Cursor Settings → Agents → Applying Changes and see whether Auto Format on Agent Finish is turned on. That option re-saves every file the agent edited when the chat ends, and it’s the most likely way an older copy of the canvas gets written back over the agent’s changes. If it’s on, please turn it off and let me know whether the reverts stop.

On the editing question: the canvas tab is only meant to show what the agent writes, so nothing in it should ever overwrite the file.

The agent suggested multiple config options that didn’t change the behavior and refused to help me change Cursor itself because it is a known issue with no solution. So I asked it to come up with a solution but couldn’t until I handheld it.

-–

name: canvas-edit-keep

description: >-

Keep the last .canvas.tsx edit when the canvas host rolls the file back.

Use when editing a canvas, a .canvas.tsx file, or when a canvas edit is

discarded, rejected, or restored after the turn.

-–

# Canvas edit keep

The canvas host can restore the previous `.canvas.tsx` when the turn ends. A patch during the turn does not last. Save a hash-named backup, then enforce that hash for a few seconds. Launch the enforcer as the last tool call before the reply. Do not edit the canvas after that launch.

## After the last canvas edit

1. Run the snapshot on the live canvas path.

```bash

python3 ~/.cursor/skills/canvas-edit-keep/scripts/snapshot.py /ABS/PATH/file.canvas.tsx

```

2. The script writes `/tmp/canvas-backup/.tsx`. It writes `/tmp/canvas-backup/LATEST` with the hash and the live path. Older hash-named copies stay in that directory.

3. Launch the enforcer in its own session. This is the last tool call of the turn.

```bash

setsid nohup python3 ~/.cursor/skills/canvas-edit-keep/scripts/enforce.py >/tmp/canvas-backup/enforce.log 2>&1 &

```

The enforcer hashes the live file every 0.2 seconds for 4 seconds. When the hash differs from `LATEST`, it copies the backup back. Read `/tmp/canvas-backup/enforce.log` only when the user asks whether the copy held.

It is on.