I am using Cursor for python and python notebooks (aka jupyter/ipython). I have fairly large notebooks that have a lot of output (for example, the file is 2.1MB, so that’s 2 million characters)
When I use agent/chat on the ipynb file, the entire file appears to be attached, including all this output. At worst, this causes the entire request to fail. Often this happens after a few conversation turns have overflowed the context. In which case I have to clear all outputs and try again. But even if it the request succeeds, it’s a big waste of context.
I would suggest that when the file is an ipynb, by default cursor should preprocess the file to remove the outputs. The user could choose to override this and include the outputs if they want. Or a specific cell or selection. I realize that dropping the outputs would make it difficult to apply suggested diffs from the agent and obviously the agent’s diffs shouldn’t clear all outputs.
I would note there are several other problems with ipynb: it’s difficult to apply changes from agent, it’s difficult to debug errors compared to straight python, etc but this context size issue is the worst.
How to reproduce:
- run a very verbose notebook. Something like print(f"hello {n}") for n in range(1,10000000) in a few cells?
- try to use agent
- keep chatting until context is too large
Cursor version:
Version: 0.49.6 (Universal)
VSCode Version: 1.96.2
Commit: 0781e811de386a0c5bcb07ceb259df8ff8246a50
Date: 2025-04-25T04:39:09.213Z
Electron: 34.3.4
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin x64 23.6.0