Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
I often have to do things with the agent that involve connecting to AWS and performing operations using the AWS cli or other tools (i.e. connect to databases.) We use a very secure approach to connecting to our AWS environments from our dev machines. We have shorter term credentials that recycle every few hours. So every few hours, we reauth, get new creds, and then we can continue.
I use this process within the agent, especially when I need to do a lot of work against AWS as the agent is juts faster overall. However, since the new terminal design dropped, there seems to be an issue. Instead of having to re-auth every few hours, it seems the agent is having to reauth, or even fully reconnect (which is a bit of a process) every few minutes!
The process we use here involves acquiring short term session credentials, that only function in a given terminal session. Once that terminal session has ended, the credentials vanish along with it. This is for security purposes, and greatly mitigates the risk that credentials ever get exposed and even i they do, there is a very limited lifetime for them.
As far as I can tell, the root cause of the issue is that terminal instances for the agent, appear to be constantly destroyed and recreated. I started opening up the terminal instance for every command the agent makes, and I rapidly discovered that new terminal instances were created all the time. I had over a dozen, for this one particular chat, and it seemed that around every 5 commands give or take, a new terminal instance was created.
This constant churn in new terminal instances, has wreaked havoc on my ability to use the agent to perform any remote work with session credentials, which we are normalizing all of our remote work and processes around for security reasons. Session credentials, however, are by design destroyed when the session ends. The agent is destroying sessions on a constant basis.
Steps to Reproduce
I don’t know that I can provide EXPLICIT steps. Generally speaking, acquire some AWS temporary session credentials via the agent (doesn’t necessarily have to be AWS though, anything that supports session credentials in the terminal). Perform some operations, eventually the agent will run into auth errors, due to a new terminal instance having been stealthily created behind the scenes.
Expected Behavior
Terminal instances, at the very least, are not churned over every few minutes, or every few commands, and can survive for longer-term operation sequences.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.7.46
VSCode Version: 1.99.3
Commit: b9e5948c1ad20443a5cecba6b84a3c9b99d62580
Date: 2025-10-14T01:21:46.830Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0
For AI issues: which model did you use?
claude-4.5-sonnet
claude-4.5-haiku
gpt-5
cheetah
Additional Information
I am not sure if this high rate of terminal churn is a part of the recent changes to terminal usage by the agent, or a part of the recent improvements in terminal stability. FWIW, though, I believe now, that various other forms of trouble I have had with the agent running terminal commands, may in fact be due to this constant background churn of terminal instances.
The models also seem to end up generating some highly convoluted commands, as I guess they may know that the terminal instances do not persist, so instead of running certain commands once, and independently of other commands, the models will often string together a dozen or even couple dozen commands with && and run them all at once. A lot of the time, that is just inapproapriate, and causes other problems, as many of the commands the models end up stuffing into these monsters are again, session commands, that should be run once per session, until they time out if they time out (which is usually hours, which is generally longer than I would have any given agent chat going).
So this terminal instance churn, is having broader impacts than just this one particular issue. These bigger and more complex commands, often fail more frequently (any early command that fails, even “benign” failures that don’t matter, will kill the whole command because of && chaining), they take longer and more tokens to generate, they take longer and more tokens to process, and it just generally is making terminal work with the agent complicated and confusing and…unreliable.
Does this stop you from using Cursor
No - Cursor works, but with this issue