Remote-SSH agent: background shell tool calls run 2–3 times; tool execution throttled to once a minute while the window is unfocused (3.18.25)

Hey, thanks for the detailed report. The logs and numbers made this a lot easier to dig into.

Both behaviors aren’t intended, and it’s not something in your setup. The slowdown when the window isn’t active is background timer throttling from the OS or runtime. It affects every tool call step approval gate, permission checks, exec stream. This is a known class of issues we’re tracking. See similar threads: Agents hang when window is not in focus and Cursor agent shell loses output when window loses focus (macOS). The command duplication is related to the same thing. When starting a tool call gets delayed under throttling, the client retries the request, and the already running background command doesn’t get cancelled before the retry goes out. That’s how you end up with multiple PIDs for one toolCallId. I’ve passed both points to the team. I can’t share an ETA yet, I’ll post in the thread when there’s an update.

Until it’s fixed, a practical workaround is to keep the Cursor window visible on screen not minimized and not on a hidden desktop, and prevent the display from sleeping while subagents are running. Your flock -n approach is a reasonable safety net for now.

About the disconnect killing subagents. With the current Remote SSH architecture, that’s expected. The agent loop and exec depend on an active connection, so if SSH drops, background work won’t keep running on its own. That’s a separate issue we’re also tracking.

One more thing. It looks like your forum account might not be the one used for the session. If you DM me the email you use to sign in to Cursor, or share Request IDs privately, I can pass your session to the team for debugging.