Agent was interrupted after working in the console for a long time

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor considers actions in the terminal as a disruptive error if the console runs for longer than 10 minutes.

Steps to Reproduce

  1. Ask the agent to run a terminal with “Hello World” and a 20-minute delay.
  2. Receive an error.

Expected Behavior

Agent can perform tasks even if they require lengthy operations in the console.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.7 (system setup)
VSCode Version: 1.105.1
Commit: 44f52350f2b7b9ee7625cfaade862ff53a016f40
Date: 2025-12-26T20:10:38.803Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.22631

For AI issues: which model did you use?

any

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

{"error":"ERROR_USER_ABORTED_REQUEST","details":{"title":"User aborted request.","detail":"Tool call ended before result was received","isRetryable":false,"additionalInfo":{},"buttons":[],"planChoices":[]},"isExpected":true}
1 Like

Related:

up!

Hey @Artemonim!

Typically, these kinds of commands should be sent to the background, where they can run longer than any timeout.

Is this happening in your case? Do you have a Request ID with privacy mode disabled that you can share?

On the contrary, I prohibit Agent from running background commands, as they don’t block its operation and Agent cannot access the results of their execution. I would even like a separate option to disable this functionality.

I use local CI in my projects (the concept can be seen in the abandoned Agent Enforcer). Currently, I’m working with the Rust language, and even with all sorts of compilation optimizations, the CI sometimes takes more than ten minutes.

1 Like

Thanks @Artemonim. I think the goal is to fix this:

Rather than infinitely increase the timeout.

The question is also that the Agent must wait for this terminal to be executed. If the terminal process takes 20 minutes, will Agent wait for it?

By the way, the OpenAI Codex has an interesting implementation: you can simply warn the agent to launch the terminal with a 20-minute timeout, and then it will know that the terminal can run for a long time and that if there was a timeout, the problem was the timeout.

Would the ideal scenario be that your agent is completely blocked for those 20 minutes, or that you can continue working? I’m thinking about something like a subagent who goes and runs the long-running terminal and reports back.

We do have a fix on the way (might already be merged) to distinguish between terminal timeouts and “user abort”, which you ran into.

Yes, I expect the Agent to launch the terminal and wait for the terminal to finish its work.

If the terminal can hang indefinitely, then that’s a flaw in the script running in the terminal, not a flaw in the Agent.

1 Like

If I understand correctly, after this update, the Agent was able to set the terminal timeout — thank you so much!

That solved the problem. UPD: That isn’t -_-

Request ID: 9aefa9f9-5485-47ce-b5bf-ae8bf8efbf4f

You’re gonna need to give me a bit more to go off of. :slight_smile: What happened?

Either the agent doesn’t always use the timeout, or it doesn’t completely solve the problem.

Ideally, I’d like to simply have a manual agent console timeout setting and the ability to disable the console timeout.

1 Like

@Artemonim

We are in exactly the same use case.

We prohibit the agent from sending commands in the background because we basically just want to wait. In background mode it burns tokens unnecessarily because agent randomly checks whether the command has finished and can sometimes decide, for no reason, to kill the process. Here, the Cursor team should just KISS: we want to run commands in the foreground and simply wait for the result before iterating.

I use 4 Cursor IDE instances in parallel on 4 different repositories, and we have an isolation system that prevents port conflicts, etc.

We run test/build commands on huge applications, and those commands can take well over 10 minutes when the agent is iterating on complex issues and needs to run many tests to ensure nothing was broken in the process. For example, we don’t want the agent to “early-exit” tests when it sees a failure, because tests are co-located and other failures with a full test report can help it fully understand the failure context.

This is really annoying, and without a workaround our agent loop is currently completely broken. We can’t use Cursor correctly. Is there a way to downgrade? When was this change introduced? Does the legacy terminal have the same issue, and can we use it as a workaround?

Please, Cursor team, fix this ASAP.

Right now the agent loop is broken, and we do not want to use background processes because they generate noise in the chat and burn tokens for no reason.

@Colin @deanrie

1 Like

I tried an approach but it’s very very bad

  • Use more token
  • Create noise
  • Arbitrary wait, when the process finally resolve, we wait for nothing
  • The agent can mess up depending of the output

Please Cursor just allow no timeout on foreground commands it worked fine… or implement a hook to notify the agent when the background command is finished

Try my Agent Compass instead of your User Rules.

I also have a separate additional User Rule defined in Cursor: Не запускай терминал в background - ты не сможешь получить к нему доступ после запуска. = Don't run the terminal in the background - you won't be able to access it after it starts..

At least in the last many weeks, the only background launch has been Sonnet 4.5, and it even seemed justified for that case (though not necessarily).

We got the foreground rule but it currently don’t work, the system still timeout it seems

@Artemonim you succeed to run foreground commands for more than 10min ?

They are executed, but after completing the work, you need to write something like “continue” in the agent chat, since Cursor interrupts the execution.

I have built-in sound notifications into CI and frequently monitor the Agent Chat, so this is inconvenient, but not critical.

I found a nice workaround

here the rule

  • **CRITICAL SUPER IMPORTANT, TRES IMPORTANT A UTILISER: Monitoring background commands `while ! tail -n 2 {backgroundCommandOutputFilePath} | grep -q “^Exited with code:”; do sleep 1; done` In case the foreground command timeout just re use the same command to wait for the exit**

Why it’s smart to combine this with a background run:

As a human, you can view the full command log if needed.

The foreground while command exits as soon as the background command exits no “sleep” tricks involved and useless latency

The agent then uses tail to read the background terminal file, seeing only the summary text.

This avoids issues with long foreground processes where the entire command output is sent to the chat, potentially saving a large number of tokens.

I’ll use this approach for now.

@deanrie @Colin is this an anti pattern ?