Skip to content

don't mirror appending output items#278458

Merged
amunger merged 1 commit intomainfrom
aamunger/appendingOutput
Nov 21, 2025
Merged

don't mirror appending output items#278458
amunger merged 1 commit intomainfrom
aamunger/appendingOutput

Conversation

@amunger
Copy link
Collaborator

@amunger amunger commented Nov 19, 2025

fix #270699

When we mirror the output edits, the actual output object is passed through to be stored on the cell of each model, so later appending to the output item of one model will affect both.
We could duplicate the outputs instead, but copilot cannot directly edit outputs, so I think it's fine to share them between the two models.

@amunger amunger marked this pull request as ready for review November 19, 2025 22:47
@vs-code-engineering
Copy link

vs-code-engineering bot commented Nov 19, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request fixes an issue where mirroring output item edits between notebook models caused unintended shared state. The PR removes the mirroring logic for NotebookCellsChangeType.OutputItem events, relying instead on the fact that output data arrays are already shared by reference between the original and modified notebook models.

Key changes:

  • Removed mirroring of NotebookCellsChangeType.OutputItem events from modified to original model
  • Added a comment explaining that outputs are shared between models

@amunger amunger merged commit ffc4b95 into main Nov 21, 2025
33 of 34 checks passed
@amunger amunger deleted the aamunger/appendingOutput branch November 21, 2025 15:40
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate output in Jupyter notebooks

3 participants