# Agent chat hangs on “Taking longer than expected…” during Python debug and stays hung after the program finishes

**URL:** <https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339>\
**Category:** Bug Reports\
**Tags:** python, chat, crashes\
**Created:** [September 19, 2026, 10:55am UTC](https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339 "2026-09-19T10:55:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grant\_Zhou](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@grant\_Zhou](https://forum.cursor.com/u/grant_Zhou)\
**Post date:** [September 19, 2026, 10:55am UTC](https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339/1 "2026-09-19T10:55:35Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

On Windows, Agent/Composer chat in the same Cursor window as an active Python debugpy session gets stuck on “Taking longer than expected…” and never streams a first token.

A brand-new chat in that debug window hangs the same way. A chat in a different Cursor window (no debug session) works normally. The Python program itself already finished — debug console printed the completion log — but the hung Agent request does not recover.

### Steps to Reproduce

1. Open a Python project in Cursor IDE on Windows.
2. Start Run and Debug (debugpy). Hit a breakpoint, or let the script run to the last line.
3. In that same window, open a new Agent chat and send any short message (reproduced with Composer 2.5 Fast and Grok 4.6 Extra High Fast).
4. The chat stays on “Taking longer than expected…” indefinitely.
5. Let the Python process finish. Debug console shows completion. The hung chat still does not recover.
6. Open Agent in another Cursor window that is not debugging — that chat works.

### Expected Behavior

Agent should stream a reply even while debugpy is paused. Finishing or stopping the debugger should not leave a new chat wedged. If IDE-state collection is slow, the request should time out with an error instead of hanging forever on “Taking longer than expected…”.

### Operating System

Windows 10/11

### Version Information

Version: 3.21.13 (user setup)  
VS Code Extension API: 1.128.x  
Commit (from update URL): 2e9476de6a44f34d9d8ef6a7585e87d563bf45528c9f05591d3a6c1570b84a9e  
Date: 2026-09-19  
OS: Windows\_NT x64 10.0.22621  
Layout: IDE Build: Stable

### For AI issues: which model did you use?

Composer 2.5 Fast; Grok 4.6 Extra High Fast (both hang)

### For AI issues: add Request ID with privacy disabled

1307e088-66cc-470b-b08d-87b9314d63cd

### Additional Information

Hung composerId: 45da357a-6e27-4073-913c-ad2a84c12309

Local cursor.requestTraces.log for request 1307e088-66cc-470b-b08d-87b9314d63cd:

- buildIdeState started at 2026-09-19T10:36:21.544Z and never got span\_completed
- gatherTerminalSelections completed in 1ms
- UI stayed on “Taking longer than expected…” after the debuggee had already finished

Same-window renderer.log:

- Extension host (LocalProcess pid: 29280) is unresponsive.
- [agent-exec] Provider registration timed out (attempt 1/9, timeout=30000ms), retrying

Also seen in the same debug window:

- 068bbbb9-fa2f-4a0c-8a5c-4bfe3f8068c5 (earlier turn, durationMs=76647)
- e6be7521-e713-4624-a6e3-fdc7ffa2f28d

cursor.general.disableHttp2 is already true. New chat does not fix it. Only a different window without that debug session works.

Related: [Agent hangs on "Taking longer than expected" after 3.21.4 update (Windows)](https://forum.cursor.com/t/agent-hangs-on-taking-longer-than-expected-after-3-21-4-update-windows/171933)

### Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [September 19, 2026, 11:43am UTC](https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339/5 "2026-09-19T11:43:32Z")

</div>

Hey, thanks for the detailed report. The logs and the Request ID help a lot.

Based on what you shared, this is what it looks like. The request gets stuck locally before it’s even sent. In your requestTraces.log, `buildIdeState` starts but never reaches `span_completed`. That’s why the chat stays on “Taking longer than expected…” with no error and no timeout. This also matches what you saw where another window works fine when there’s no active debug session. So it’s not a network issue, not the model, and not something in your setup.

This is a known issue and we’re tracking it on Windows. I’ve added your case to it. The detail about the debugpy session is new and really useful.

The workaround you already found is still the most reliable one for now. Keep Agent chat in a separate Cursor window from the one running the debugger.

To confirm the debugger is the trigger, two tests would help:

1. Create an empty folder and open it in Cursor via File \> Open Folder.
2. Add one file `hello.py` with `print("hi")`.
3. Start it via Run and Debug using `F5` with Python Debugger.
4. While the debug session is active, open a new Agent chat and send “hello”. Does it reply, or does it hang on “Taking longer than expected…”?
5. Go back to your normal Python project, fully stop the debugger so there’s no active debug session, open a new Agent chat, and send “hello”. Does it reply?

If the chat hangs in any of these tests, please run `Developer: Capture and Send Debugging Data` in the same window via Command Palette using `Ctrl+Shift+P` with default settings, then reply here with the result of each step, the Request ID of the hanging request, and the send time including your timezone. That bundle will show exactly which local step it’s getting stuck on.

I can’t share an ETA yet, but I’ll post in the thread if there’s an update.

---

<div class="post-metadata">

**Author:** ![grant\_Zhou](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@grant\_Zhou](https://forum.cursor.com/u/grant_Zhou)\
**Post date:** [September 20, 2026, 7:13am UTC](https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339/7 "2026-09-20T07:13:27Z")

</div>

Follow-up for @deanrie — this is your test #2 (debugger fully stopped), and it still hung.

\*\*When:\*\* 2026-09-20 15:06 CST (UTC+8)  
\*\*Window:\*\* same Python project as before (KingDeeCleaningBillSynBI). Source Control was open; PowerShell idle; \*\*no active debugpy session\*\* (yellow in the editor was git diff, not a breakpoint).  
\*\*Chat:\*\* brand-new Agent chat, Grok 4.6 Extra High Fast. Same window hung; a different Cursor window without that project still worked.

\*\*Request IDs\*\*

- Hung new chat: `46564b07-4e0a-4f46-bc97-d3f251a4703e` (composerId `669ecf8b-8e3a-4ebf-affd-2cd291654952`)
- Hung older chat in the same window two minutes earlier: `bf24b8ad-c6c1-425f-a9f6-d03a11164c51` (composerId `5095385f-c515-4ac4-a221-ed1d2c663cd0`)

Both traces: `buildIdeState` started, never `span_completed`. `gatherTerminalSelections` completed in a few ms.

\*\*What happened to the extension host in that window before the hang\*\*

```  
2026-09-20 14:32:08 [IdleTimeContribution] Hard stopping cursor builtin extension hosts after 30 idle minutes (threshold=30, freeMemory=7.7%, freeMemoryThreshold=10%).  
```

After that, repeated:

```  
Error fetching user privacy mode: No Connect transport provider registered.  
Error: No Connect transport provider registered.  
```

Then at 15:02 the window regained focus and restarted extension hosts, and at 15:04 / 15:06 the Agent requests stuck on `buildIdeState`.

So debugger is not required. After idle-kill of builtin hosts (low free memory), this project window still wedges Agent on `buildIdeState`. I can run `Developer: Capture and Send Debugging Data` from that hung window if you want the bundle.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [September 20, 2026, 12:52pm UTC](https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339/11 "2026-09-20T12:52:12Z")

</div>

Hey, thanks for running test #2 and sharing the log lines. That answers the question, the debugger isn’t the trigger. The common factor in both cases is that the built-in extension host was stopped by the idle killer in that window when free memory was low, `freeMemory=7.7%`, and then restarted. After that, the window hangs the Agent on `buildIdeState`. The `No Connect transport provider registered` lines are the window noting that the host was off at that moment, not the cause of the hang.

Yes, please send the bundle. In the hung window, open the Command Palette with `Ctrl+Shift+P`, run `Developer: Capture and Send Debugging Data` with the default settings, then reply here with the send time including your timezone and the Request ID of the hung message. It’s uploaded directly from your account, nothing else needed.

One more quick test will help narrow this down. Both times the hang happened with the terminal open in the window.

1. In the project window, run `Developer: Reload Window` from the Command Palette.
2. Close the terminal panel with `Ctrl+J` until it hides, and close Source Control.
3. Open a new Agent chat and send “hello”. Does it reply?
4. Now open the terminal again with `Ctrl+J`, keep it visible, open another new Agent chat, and send “hello”. Does it reply or hang?

No need to update. You’re already on the latest stable 3.21.16, and it reproduces there. This is a known issue we’re tracking on Windows, and your case is attached to it. Until it’s fixed, the reliable workaround is to keep the Agent chat in a separate Cursor window, or in the Agents Window via `Open Agents Window` in the Command Palette. I don’t have an ETA yet, but I’ll post here when there’s an update.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [October 1, 2026, 5:02pm UTC](https://forum.cursor.com/t/agent-chat-hangs-on-taking-longer-than-expected-during-python-debug-and-stays-hung-after-the-program-finishes/172339/13 "2026-10-01T17:02:43Z")

</div>

Hey @grant_Zhou!

The fix for the Agent chat getting stuck on “Taking longer than expected” in your project window is included in the latest version of Cursor.

Looks like you’ve already updated, so this should be resolved for you. Can you confirm that new Agent chats in that project window (KingDeeCleaningBillSynBI) are responding normally now?

If anything is still getting stuck, let me know, include the Request ID from the stuck message, and we’ll take another look. Also, thanks again for the tests, they really helped us figure this out.
