Open xl0 opened 1 month ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.95.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
To clarify, the behavior is the same in the latest version of vscode/extensions. I have highlighted the first release that has the issue.
Does this issue occur when all extensions are disabled?: Yes/No
I'm working on a tool that allows interacting with LLMs from Jupyter notebooks, and let the LLM create and run cells in your notebook. To provide the context to the LLM, I, among other things, need to find the cell that is currently being executed in the notebook: https://github.com/ConGustoAI/friendlly
Before 1.93.1, the
execution_count
in the saved.ipynb
would update immediately when the file is saved. So I can enable autosave with a small (200ms) delay, and find the cell with the execution count that matches the currentget_ipython().execution_count
.In my code, I trigger a save by emitting an empty JS output
display(JavaScript(""))
, and the file is saved as the cell is executing.As of 1.93.1, the execution count, and likely other data/metadata does not seem to get updated in the saved file, as the cell is being executed.
Simplified code to find the exec_count of the cells in the file:
The code:
In 1.92.2 the count in the file is consistent with the exec count from get_ipython():
In 1.93.1, the count in the file is inconsistent:
Note: I'm using the same versions of Python/Jupyter extensions that are compatible with both versions of VSCode: Python: v2024.8.1 Jupyter: v2024.6.0
so it's likely not an issue with the Jupyter extension.