microsoft / microsoft/vscode

Notebook edits by Copilot agent spawn multiple untitled notebook duplicates

Open
#330,951 0 comments 0 reactions 1 assignee Claimed by @DonJayamanne View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Version

- VS Code: 1.132.0 (df53daabb18cd157bdb08c7f01c34df936cf12f4, x64)
- OS: Windows
- ms-toolsai.jupyter: 2025.9.1

### Does this issue occur when all extensions are disabled?

Not tested — the Jupyter extension is required to reproduce.

### Steps to Reproduce

1. Open a workspace containing a `.ipynb` file.
2. Ask Copilot (agent mode) to make edits to that notebook, over several turns.
3. Observe new dirty `Untitled-N.ipynb` editors appearing after edit rounds.

### Expected

Edits apply to the target notebook only. No additional untitled notebook documents are created.

### Actual

Each edit round spawns one or more dirty `Untitled-N.ipynb` editors that are full duplicates of the notebook being edited. They persist as backups under `%APPDATA%\Code\Backups\\untitled\` and are restored on subsequent window startups.

### Evidence

Observed on two consecutive days with the same signature.

**Day 1** — real file `39,831 B`, modified 21:39:14:

| Document | Backup written | Size |
| --- | --- | --- |
| Untitled-1.ipynb | 21:38:56 | 40,161 B |
| Untitled-2.ipynb | 21:39:42 | 40,161 B |
| Untitled-3.ipynb | 21:39:55 | 40,161 B |

**Day 2** — real file `42,594 B`:

| Document | Backup written | Size |
| --- | --- | --- |
| Untitled-2 | 19:55:49 | 42,809 B |
| Untitled-3 | 19:55:56 | 42,809 B |
| Untitled-6 | 19:56:08 | 42,809 B |
| Untitled-7 | 19:56:19 | 42,809 B |
| Untitled-1 | 19:57:42 | 42,809 B |
| Untitled-4 | 20:19:26 | 42,809 B |

Verified by parsing the backup payload against the on-disk notebook:

- Identical cell count (13 vs 13)
- First cell source matches byte-for-byte
- Untitled sizes track the real file's growth across days (32,248 → 40,161 → 42,809), confirming they mirror the edited notebook

### Additional notes

- The backup directory hash has **no corresponding `workspaceStorage` entry**, i.e. the untitled documents are bucketed against an *empty window*, not the open workspace.
- Gaps in the numbering (`Untitled-5` absent; 6 and 7 present) indicate more copies are created than are persisted — some are closed before the backup flush.
- `"files.hotExit": "off"` stops them surviving a restart but does **not** prevent creation.
- No duplicate notebook extensions installed; no OneDrive conflict copies on disk.
- Deleting the backup files while the editors are open is ineffective — VS Code rewrites them on the next flush.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.