Bug: Orphaned agent-exec shell storm maxes CPU after Plan Mode finishes (multi-root + custom SSH GitHub host)
Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Summary
After a Plan Mode agent finished and left a plan awaiting confirmation, Cursor’s extension-host (agent-exec) for a multi-root workspace continued spawning dozens of parallel sandboxed zsh shells running invalid gh pr list --hostname … / gh --version commands across every workspace git root. This saturated a 16-core M4 Max (load averages 25–32, ~0% idle) for 15+ minutes with no visibly running agent in the UI.
Killing the agent-exec process does not stop it: Cursor immediately respawns a new agent-exec host and the same gh storm resumes.
Environment
- Cursor: 3.13.21 (stable), commit
55434bd8062ece6fee083b82beed2aee42d253f0 - OS: macOS 26.5.2 (Build 25F84), Darwin 25.5.0 arm64
- CPU: Apple M4 Max (16 cores)
- Shell: zsh (Oh My Zsh / Powerlevel10k in user environment; agent shells use Cursor sandbox wrapper with
dump_zsh_state) - gh: 2.96.0
- Workspace: multi-root
.code-workspacewith 20+ folders, nearly all on branchswitch-to-vite - Git remotes: SSH host alias form
[email protected]:amigo-framework/<repo>.git(notgithub.com) - Related plan: Plan Mode completed at ~14:24 local; plan file
react-19-upgrade_*.plan.md; agent transcript id026f2542-cf70-4d82-a996-d568d915b7f2showedturn_ended/ success and was not growing while the storm continued - Extensions present (may be unrelated): GitHub Pull Requests 0.156.0, GitLens 18.3.0, GitHub Actions 0.32.3
Expected Behavior
Once Plan Mode finishes and is waiting for user confirmation to build:
- No further agent shell tool executions
- CPU returns to normal baseline for an idle multi-root window
Actual
Cursor Helper (Plugin): extension-host (agent-exec) application-amigo-6continuously spawned ~15–25 child zsh processes- Each child used Cursor’s sandbox wrapper (
snap=$(command cat <&3); …; dump_zsh_state) and ran either:gh pr list --hostname "github.com-avatarux" --repo "amigo-framework/<repo>" --head "switch-to-vite" --state all --json urlgh --version
- Observed for 15+ minutes after the plan chat appeared idle
- Load average peaked around 32 on 16 cores; Activity Monitor /
psshowed many/bin/zshat 50–80% CPU each (startup/dump_zsh_stateoverhead dominates) - Some shells hung >8 minutes stuck on
catreading sandbox fd 3 (snap=$(command cat <&3)) gh pr list --hostname …is an invalid invocation (unknown flag: --hostname); hostname belongs onghglobally /GH_HOST, not as apr listflag — so these calls fail immediately and appear to be retried in a loop- Killing agent-exec PID caused immediate respawn (
[1-4]→[1-9]) and storm continued
Additional signals from local state
workbench.backgroundComposer.workspacePersistentData contained:
{
"cachedSelectedRemote": {
"name": "origin",
"url": "github.com-avatarux/amigo-framework/application"
},
"cachedSelectedGitState": {
"ref": "main",
"continueRef": "switch-to-vite",
"autoBranch": true
}
}
Note continueRef: switch-to-vite matches the --head filter being spammed, and the remote URL embeds the SSH host alias that is incorrectly passed as --hostname.
Impact
- Machine unusable / fans high / load 2× core count
- Happens while user believes agent work is finished (plan awaiting confirm)
- Process-level kill is ineffective due to respawn + persisted work queue
- Workaround that should work: Developer: Reload Window or close the multi-root workspace window (not verified in this report if reload clears the queue; process kill alone does not)
Request
Please investigate:
- Why agent-exec keeps scheduling shell tools after Plan Mode turn end / with no visible running agent
- Why invalid
gh pr list --hostname <ssh-host-alias>is generated from remotes like[email protected]:org/repo.git - Why failures appear to retry indefinitely across all multi-root folders
- Why killing agent-exec respawns and resumes the same storm (persisted pending tool queue?)
Diagnostics captured
Local dump: /tmp/cursor-cpu-storm-bug-20260728-144137/diagnostics.txt (also summarized above). Happy to attach Request ID if needed (Plan Mode chat: transcript 026f2542-cf70-4d82-a996-d568d915b7f2).
https://pastebin.com/9yg3Pk9q
Steps to Reproduce
(approximate)
- Open a multi-root workspace with ~20 git folders
- Use SSH remotes with a custom host alias (e.g.
github.com-avataruxin~/.ssh/config) - Check out the same feature branch (e.g.
switch-to-vite) on most roots - Run a Plan Mode agent that surveys the multi-root workspace / git state (React upgrade plan in our case)
- When the plan is presented and awaiting confirmation, do not click build
- Observe system CPU: agent-exec continues firing parallel
gh pr list --hostname <ssh-alias> --head <branch>across repos even though UI shows no running agent
Operating System
MacOS
Version Information
Cursor IDE: 3.13.21 (stable), commit 55434bd8062ece6fee083b82beed2aee42d253f0
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor



