Cursor-agent (Windows): updater flashes console windows for ~36 min with stale .running markers

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

When a cursor-agent update is staged on Windows 11, console windows flash open and close about once a second, for up to about 36 minutes. Windows Terminal is set as the default terminal.

Diagnosis found four orphaned *.pending.replace.cmd updater waiters in %LOCALAPPDATA%\cursor-agent\versions\pending-launchers, for agent.cmd, agent.ps1, cursor-agent.cmd and cursor-agent.ps1. Their parent process had exited. Before stopping these waiters, 24 new console windows appeared in 20 seconds; after stopping them, none appeared during a 20-second check.

Steps to Reproduce

  1. Run cursor-agent on Windows and terminate it forcibly (for example, taskkill /T /F on the agent process tree, or a tool timeout that kills it). Repeat over multiple runs/versions so .running markers accumulate.
  2. Stage a cursor-agent self-update while the installation is considered in use.
  3. Observe the pending-launchers/*.pending.replace.cmd processes and repeated console windows.

The long wait depends on stale marker PIDs being reused by unrelated live processes; this makes reproduction timing dependent. On the affected machine, 5,087 leftover markers existed across 12 version folders, none belonging to a running cursor-agent. About 110 matched unrelated live PIDs.

Expected Behavior

Updates should wait silently, ignore/remove stale process markers, and complete once no actual cursor-agent process is using the installation. Hard-killed runs should not leave permanent markers that block future updates.

Operating System

Windows 10/11

Version Information

cursor-agent 2026.10.18-ea085cb
Also observed with 2026.10.16-e3cb207
Windows 11; Windows Terminal configured as the default terminal.

Additional Information

Cause identified during local investigation:

  1. Marker leakage: install-in-use-marker.ts writes versions/<ver>/.running/<pid> and deletes it through process.once("exit"). Forced termination skips that handler.
  2. Stale markers are not pruned by the cmd waiter: unlike the Node checker, pending-launchers/*.pending.replace.cmd checks each marker using tasklist /FI "PID eq <pid>" plus find every 6 seconds without removing dead markers. Reused Windows PIDs can match unrelated live processes, keeping the install marked in use until EXITWAIT (360 × 6 seconds, about 36 minutes).
  3. Visible console children: the four orphaned waiters have no console of their own. Their tasklist/find children create visible consoles (OpenConsole.exe -Embedding), producing continuous flashing.

Suggested fixes:

  • Start pending-replace waiters/children with windowsHide / CREATE_NO_WINDOW, or implement the check in Node.
  • Prune dead/stale markers in the waiter, as the Node checker already does. Validate process identity (not just PID existence), using image identity and/or process creation time to reject reused PIDs.
  • Clean up stale markers at startup so forced terminations do not accumulate indefinitely.

Workaround used: remove versions/*/.running/* markers only after verifying they do not belong to an active cursor-agent process, then terminate the orphaned *.pending.replace.cmd waiters. This stopped the flashing; terminating waiters may defer applying the staged update.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey @serrnovik,

Thanks for the report. Your diagnosis matches what we see: the updater’s background waiter checks the .running markers but doesn’t clear ones whose process is gone, and its checks open console windows. I’ve flagged this to the team.

In the meantime, your workaround is safe if you do it while nothing from cursor-agent is running:

  1. Close every cursor-agent session, including any agent worker.
  2. Delete everything inside %LOCALAPPDATA%\cursor-agent\versions\*\.running\. With no agent running, all of those markers are stale.
  3. End the cmd.exe processes running *.pending.replace.cmd from versions\pending-launchers.
  4. Run cursor-agent update once, which should apply the staged update.

Markers can build up again after hard-killed runs, so repeat these steps if the flashing comes back.

Same thing here: 2026.10.14-0f9edde and 2026.10.18-ea085cb on Windows 11 (10.0.26200). I had 636 stale markers across 11 version folders, 11 of whose PIDs belonged to unrelated processes. My findings agree with the diagnosis above. There are four details I can add:

  1. Markers leak on clean exits too, not only after a forced kill. I ran cursor-agent -p --force --output-format stream-json … twice in a row on 2026-10-20. Both runs ended normally with exit code 0, and each one left exactly one .running\<pid> marker behind (PIDs 53716 and 58184). So scripted users will build up markers even if they never kill a process. That means the workaround has to be repeated after ordinary use as well, not only after hard kills.
  2. The detached waiter inherits the parent’s stdio handles. If a wrapper reads cursor-agent’s stdout until EOF, it hangs until the *.pending.replace.cmd processes exit, even though cursor-agent has already finished. Spawning the waiter with stdio: 'ignore', detached: true and windowsHide: true would fix both this and the windows.
  3. The cost grows with the number of markers. Every pass spawns tasklist + find for each marker, in each of the four waiters. With 636 markers that comes to about 5,000 process starts per round. Each start also creates a versions\tasklist-<pid>-<rand>.txt temp file, and interrupted runs leave those behind. The real run time is longer than the 360 × 6 s budget, because the scan time is added on every pass.
  4. find "N" matches substrings, so a short PID can match other columns of the tasklist output. On the Node side, process.kill(pid, 0) counts EPERM as alive, so a reused PID that belongs to a protected or system process also looks like a live agent.

Workaround for scripted use: before and after each run, delete every versions\*\.running\<pid> whose PID is not a live process whose image path is inside versions\. I check this with OpenProcess/QueryFullProcessImageNameW, so the check starts no child processes and opens no windows. Since adding that, the updater hasn’t started its polling loop again.

Same bug reproduced on 2026-10-20, Windows 11 (10.0.26200), Windows Terminal as the default terminal.

A live cursor-agent 2026.10.16-e3cb207 (a --resume session, parent still running) spawned three

waiters:

  • cmd.exe /d /s /c call “.\cursor-agent.ps1.pending.replace.cmd”

  • cmd.exe /d /s /c call “.\agent.cmd.pending.replace.cmd”

  • cmd.exe /d /s /c call “.\agent.ps1.pending.replace.cmd”

They looped on ping -n 6 127.0.0.1, tasklist /FI “PID eq …”, and find.exe. Each child opened a visible

console (WindowsTerminal.exe / OpenConsole.exe -Embedding).

Ending those three cmd trees stopped the flashing immediately. The parent node did not respawn them.

This case differs slightly from the original report: the waiters were not orphaned; their parent agent

was still alive.

A newer agent (2026.10.19-6bbf2c4) was running at the same time and was left untouched.

Confirmed on Windows with Cursor CLI 2026.10.19-6bbf2c4. We found four pending-replacement waiters scanning 656 stale markers. Reused PIDs matched unrelated live processes, keeping the waiters active.

An isolated reproduction using the installed bundle confirmed that an unrelated live PID incorrectly marks the installation busy. A local adaptation verifies executable identity and process creation time and removes background batch polling. After installation, seven snapshots over 31 seconds showed zero updater waiters or polling children. This is a local workaround; the vendor defect remains unresolved.

Hey @serrnovik,

A fix for the cursor-agent updater flashing console windows and getting stuck on leftover .running markers has landed and will be included in an upcoming version of the Cursor CLI. The updater’s background check no longer opens console windows, and it now clears markers whose process has exited or whose ID now belongs to a different program.

It may already be out by the time you read this, so it’s worth running cursor-agent update and checking. If the windows flash one more time while that update is being applied, the cleanup steps earlier in this thread will clear it.

Let me know if you still see the flashing after you’re on the new version.

cc @Richard_Huffman @wangzaidada @bompus