Skip to content

Codex writes to stale file version when jupyter notebook has unsaved changes #20182

@lourinhos

Description

@lourinhos

What version of the IDE extension are you using?

26.422.71525

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Linux 6.14.5-100.fc40.x86_64 x86_64 unknown

What issue are you seeing?

When using the Codex VS Code extension, the extension writes changes to the file based on the older saved version rather than the currently open notebook state. If the notebook has unsaved changes, this creates a conflict where VS Code forces the user to choose between saving and losing the Codex edits, or discarding their own unsaved notebook changes. This means that each time the user prompts for changes to the notebook they must close and reopen the notebook.

What steps can reproduce the bug?

Steps to reproduce

  • Open a notebook file in VS Code.
  • Make changes in the notebook (e.g. run a cell), but do not save them.
  • Ask the Codex VS Code extension to edit the same notebook/file.
  • Let Codex apply the suggested changes.
  • The changes to not immediately appear in the notebook and the user must choose between:
    • saving their notebook changes and losing the Codex edits, or
    • discarding their unsaved notebook changes to keep the Codex edits, in addition to closing and reopening the notebook.

What is the expected behavior?

The extension should save or otherwise account for the current notebook state before applying file changes, so the user does not have to resolve a stale-version conflict manually.

Additional information

This was observed on VSC Server

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extension

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions