When a parent chat in IDE mode (Editor layout) launches a background subagent, the subagent finishes all work and writes {"type":"turn_ended","status":"success"}, but the inline subagent card in the parent chat stays stuck on "running" and never returns the completion event to the parent chat.
Furthermore, when the parent chat subsequently sends a follow-up request (Task with resume and interrupt: true) to that same subagent, delivery stalls for ~3 minutes, and the two on-disk transcript files for the subagent split and become permanently desynced.
Steps to Reproduce
The parent chat starts subagent 8651a711-a3a7-4d13-8397-e7abd921cca0. The inline card in the parent chat shows "running".
At 11:44:52 UTC+8, the subagent finishes all work, cleans up its background browser space, answers the "Briefly inform the user about the task result" prompt, and writes {"type":"turn_ended","status":"success"} (line 73).
However, the inline subagent card in the parent chat stays stuck on "running".
The user clicks into the subagent card and sees that it has already finished (no thinking, no output).
Only then (11:47 UTC+8) does the user return to the parent chat and ask it to check the subagent because the card is still spinning. The parent calls Task on 8651a711-a3a7-4d13-8397-e7abd921cca0 with resume and interrupt: true.
Delivery of that follow-up request takes ~3 minutes, and the two on-disk transcript files for this subagent diverge:
Top-level transcript (agent-transcripts/8651a711-a3a7-4d13-8397-e7abd921cca0/8651a711-a3a7-4d13-8397-e7abd921cca0.jsonl): remains frozen at 73 lines, last modified at 11:44:52 (turn_ended). The opened subagent view in the UI never shows the follow-up prompt.
Nested subagent transcript under parent (agent-transcripts/b430a01d-6aa9-4be2-b2af-9b81d2c96d0e/subagents/8651a711-a3a7-4d13-8397-e7abd921cca0.jsonl): finally receives the follow-up prompt at 11:50 (line 74) and finishes with a second {"type":"turn_ended","status":"success"} at 11:51:11 (line 77, 133,187 bytes).
Even after the second turn_ended at 11:51:11, a screenshot around 11:58 UTC+8 (~14 minutes after the original completion) still shows the inline card in the parent chat spinning as "running".
Earlier Reproduction (Same Parent Chat)
On 2026-10-27 around 11:41–12:04 UTC+8, subagent c81c9d27-060a-49af-b002-9293d81c220a exhibited the exact same transcript split:
agent-transcripts/c81c9d27-060a-49af-b002-9293d81c220a/c81c9d27-060a-49af-b002-9293d81c220a.jsonl stopped updating at 11:41:49 (126 lines, turn_ended).
agent-transcripts/b430a01d-6aa9-4be2-b2af-9b81d2c96d0e/subagents/c81c9d27-060a-49af-b002-9293d81c220a.jsonl received a resume prompt at 12:00 and ended at 12:04:56 (133 lines), while the UI and top-level transcript remained desynced.
Expected Behavior
When a subagent reaches turn_ended, the parent inline card immediately leaves "running" and delivers the final text to the parent chat without requiring the user to inspect the subagent manually.
agent-transcripts/<subagent-id>/<subagent-id>.jsonl and agent-transcripts/<parent-id>/subagents/<subagent-id>.jsonl must stay in sync.
Follow-up Task(resume, interrupt) calls to a subagent should be delivered promptly rather than stalling for minutes behind a desynced "running" state.
Operating System
Windows 10/11
Version Information
Cursor IDE 3.27.22 (b1aa50cb6db84fd3e8c808259cb172ea73425c10), x64. Workspace opened from WSL2 on Windows desktop.
Subagent ID:8651a711-a3a7-4d13-8397-e7abd921cca0 (subagent_type: "generalPurpose", model: "cursor-grok-4.6-high", launched with run_in_background: true)
Impact
The subagent’s work is already done, but the parent chat waits indefinitely as if it were still running. Asking the parent to check then triggers a second multi-minute stall because the follow-up request to that subagent is held back / delayed.
Related (Separate Navigation Issues — Please Keep Separate)
Opening a subagent from the IDE parent chat overwrites the parent tab, and the subagent page has no back button:
Hey @JinFeng_Xie, thanks for the report and the timestamps.
I looked at both subagents you listed (today’s and the one from Oct 27), and they show the same pattern. The subagent finished its main work, and a few seconds later a background command it had started on its own also finished. That woke the subagent for one more short turn (the “Briefly inform the user about the task result” reply you saw). That extra turn is what landed in the top-level transcript. After it, the subagent’s original task never reported back as finished, so the card in the parent chat kept showing running until the parent’s follow-up interrupted it a few minutes later.
I’ve flagged this to the team.
In the meantime, two things should help:
When you launch a background subagent, ask it to wait for any background commands it starts to finish (or stop them and wait for them to exit) before it gives its final answer. The stuck card shows up when one of those commands finishes after the subagent is already done.
If a card does get stuck, ask the parent to read the subagent’s transcript files directly instead of resuming it with an interrupt. The result is in those files, and reading them skips the multi-minute wait.
To help us confirm the trigger, could you try this in a new chat?
Open a new Agent chat in the Editor layout.
Send: “Launch one background subagent. Its task: run sleep 20 && echo done as a background terminal command, then reply ‘started’ right away without waiting for it.”
Wait about 30 seconds without sending anything.
Check whether the subagent’s card in the parent chat still shows running, and whether a top-level agent-transcripts/<subagent-id>/<subagent-id>.jsonl file appeared in addition to the one under subagents/.
With the help and guidance of Gemini 4 Argon in Cursor, I ran three controlled reproduction tests in the Editor layout today and diffed all the on-disk .jsonl transcripts and terminals/*.txt metadata line by line. We reproduced the exact transcript split and pinned down the full 3-part mechanism behind the stuck "running" card:
1. Your sleep 20 && echo done test (Parent 58a15b15, Subagent eb11b588)
09:43:12.848 UTC+8: Subagent eb11b588 started sleep 20 && echo done with block_until_ms: 0 (terminals/302596.txt).
09:43:29.223 UTC+8 (16.4s later): The subagent replied started and reached {"type":"turn_ended","status":"success"}beforesleep 20 finished. Because no background shell had exited yet, the parent card transitioned to Completed normally.
09:43:29.253 UTC+8 (30ms after turn_ended): Cursor automatically aborted the subagent’s still-running sleep 20 process (status: aborted, elapsed_ms: 16405).
Split transcript confirmed: That aborted event immediately woke the subagent with "Briefly inform the user about the task result..." and created the split top-level transcript:
agent-transcripts/58a15b15.../subagents/eb11b588....jsonl stopped at 5 lines (09:43:29.223).
agent-transcripts/eb11b588.../eb11b588....jsonl was created at 09:43:50.179 with 8 lines containing the extra wake-up turn.
To match what happened in 8651a711 and c81c9d27 (where backgrounded commands exited or were killed while the subagent was still running), Gemini 4 Argon guided me to run a 5-step subagent test:
Start echo $$ > /tmp/repro_bg.pid && sleep 40 && echo bg1_done with block_until_ms: 2000 (moves to background, shell_id: 855983).
Call AwaitShell on 855983 with block_until_ms: 2000 (times out).
Run kill $(cat /tmp/repro_bg.pid) to kill the first background command.
Run a second command sleep 4 && echo bg2_done with block_until_ms: 1000 (shell_id: 855984), then AwaitShell (block_until_ms: 5000) until it finishes.
Reply all_done.
Result — 100% identical transcript structure to 8651a711:
agent-transcripts/bdb2d343.../subagents/bf197f7d....jsonl stops at 10 lines (L9"all_done", L10turn_ended).
agent-transcripts/bf197f7d.../bf197f7d....jsonl (13 lines) has no turn_ended after L9"all_done"; instead it is immediately followed by:
L10: an empty timestamp-only user message ({"role":"user","message":{"content":[{"type":"text","text":"<timestamp>Friday, Oct 30, 2026, 10:02 AM (UTC+8)</timestamp>"}]}}) — identical to L70 in 8651a711!
L11: "Briefly inform the user about the task result..."
L12: assistant summary of the two background commands
L13: {"type":"turn_ended","status":"success"}
3. The 3 linked bugs revealed by the transcripts (and why 8651a711 stayed stuck on "running")
Comparing all transcripts (8651a711, c81c9d27, eb11b588, 36a87e6d, bf197f7d) shows three connected bugs in how Cursor handles background shells started inside a subagent:
Bug 1 — Subagent background shell events leak into the parent chat:
Whenever a background Shell inside a subagent exits or is aborted, Cursor injects "Briefly inform the user about the task result..." not only into the subagent, but also into the parent chat (58a15b15 line 9, 9bcdb777 line 6, bdb2d343 line 7, and b430a01d lines 5606 & 5610). The parent chat is woken up mid-flight to inspect a terminal file that belongs to the child subagent.
Bug 2 — Transcript path split + empty <timestamp> user turn:
When a subagent’s background command exits and triggers the "Briefly inform..." follow-up turn (especially with AwaitShell + kill, which also injects an empty <timestamp> user message right before "Briefly inform..."), Cursor writes that follow-up turn into a newly created top-level file agent-transcripts/<subagent-id>/<subagent-id>.jsonl, permanently diverging from agent-transcripts/<parent-id>/subagents/<subagent-id>.jsonl.
Bug 3 — Race/collision that drops the subagent completion event (causes the permanent "running" card):
Why did 8651a711 stay on "running" forever while bf197f7d marked Completed?
In bdb2d343 (bf197f7d), the leaked "Briefly inform..." turn in the parent chat (L7–L9) had already finished (turn_ended at 10:02) before the subagent finished at 10:03, so the parent was idle and successfully received L11 ("Perform any necessary follow-up actions in response to the subagent completion above").
In b430a01d (8651a711), the second leaked "Briefly inform..." from the subagent’s background shell woke the parent chat at 11:44 (b430a01d.jsonlL5610–L5612). While the parent chat was actively mid-turn handling that leaked shell notification, subagent 8651a711 finished its own "Briefly inform..." turn at 11:44:52 (L70–L73). Because the parent was busy running L5610–L5612 and the subagent was already on its split top-level transcript turn, the "Perform any necessary follow-up actions in response to the subagent completion above" event for 8651a711 was completely dropped—it never appears anywhere in b430a01d.jsonl. As a result, the inline card in the parent chat remained stuck on "running" indefinitely.