Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Description

Timeline entries for notebooks with Copilot Edits fail to open with SyntaxError: Unexpected token '#', "# Display "... is not valid JSON because the timeline stores notebooks in an internal snapshot format (JSON.stringify([transientOptions, notebookData])) while the ipynb serializer expects standard Jupyter JSON.

Changes

  • Detection: Check notebookViewType in getContentAtStop to identify notebook files
  • Conversion: Added _convertNotebookSnapshotToSerializedFormat method that:
    • Deserializes internal snapshot to NotebookData
    • Uses INotebookSerializer.notebookToData() to convert to Jupyter JSON bytes
    • Decodes bytes to UTF-8 string
    • Returns valid empty notebook on conversion failure
// Before: returns internal snapshot format
return replayed.exists ? replayed.content : undefined;

// After: converts notebooks to Jupyter JSON
if (replayed.notebookViewType) {
    return this._convertNotebookSnapshotToSerializedFormat(replayed.content, replayed.notebookViewType);
}
return replayed.content;
Original prompt

This section details on the original issue you should resolve

<issue_title>Timeline - can not open notebook with edit changes</issue_title>
<issue_description>Testing #241775

  1. Open any notebook
  2. Use Copilot Edits to make some changes to the notebook
  3. Go to Timeline view
  4. Click on Edits entry in timeline view -> Editor can not open
Image

Error in dev console

SyntaxError: Unexpected token '#', "# Display "... is not valid JSON
    at JSON.parse (<anonymous>)
    at deserializeNotebook (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/ipynb/dist/ipynbMain.node.js:1:167914)
    at Sh.$dataToNotebook (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:8563)
    at Vy.S (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:116244)
    at Vy.Q (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:116024)
    at Vy.M (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:115075)
    at Vy.L (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:114351)
    at Ah.value (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:113015)
    at P.B (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2375)
    at P.fire (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2593)
    at Jn.fire (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:9459)
    at Ah.value (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:190:13324)
    at P.B (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2375)
    at P.fire (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2593)
    at Jn.fire (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:9459)
    at MessagePortMain.<anonymous> (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:190:11616)
    at MessagePortMain.emit (node:events:518:28)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2949)
    at Object.callbackTrampoline (node:internal/async_hooks:130:17)

fyi @jrieken </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits December 10, 2025 02:44
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with opening notebook after edits in timeline Fix timeline view failing to open notebooks with chat edit changes Dec 10, 2025
Copilot AI requested a review from DonJayamanne December 10, 2025 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeline - can not open notebook with edit changes

2 participants