The agent ran tests across many conversations after implementing my requirements. Turns out, the node processes that seemingly ran the tests are kept alive even if the conversation was over, resulting in an unnecessary memory consumption.
Steps to Reproduce
I just did what anyone might usually do. Start a new agent conversation, generate a plan, build. The AI will implement things and it will run Vitest tests and build scripts to ensure nothing broke.
It seems though that the terminal used by the agent to test is not terminated properly as seen in my screenshot.
Expected Behavior
There shouldn’t be any alive processes for tests that should’ve been finished.
This is a known issue. The agent’s background terminal processes don’t shut down properly after a session ends. The team is aware and is working on a fix.
For now, as a workaround, please quit the vitest processes manually in Activity Monitor after using the agent, or restart Cursor when memory usage gets critical.
I ended up creating another npm command called testOnce that doesn’t watch for changes and made the agent use that command when it needs to run test. Since then I have had no vitest processes kept alive.
Hey Jerry, mind sharing the actual command you wrote for testOnce in the package.json? I have this problem as well, and would love to help my team and I avoid it until it’s fixed proper in Cursor IDE.