# ACP edit file hangs

**URL:** <https://forum.cursor.com/t/acp-edit-file-hangs/161370>\
**Category:** Bug Reports\
**Tags:** acp, cli, anthropic\
**Created:** [May 23, 2026, 2:36am UTC](https://forum.cursor.com/t/acp-edit-file-hangs/161370 "2026-05-23T02:36:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurij\_Gera](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jurij_gera/32/103209_2.png) [@Jurij\_Gera](https://forum.cursor.com/u/Jurij_Gera)\
**Post date:** [May 23, 2026, 2:36am UTC](https://forum.cursor.com/t/acp-edit-file-hangs/161370/1 "2026-05-23T02:36:59Z")

</div>

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

Somewhere else…

### Describe the Bug

Cursor acp agent hangs indefinitely on larger files.  
When using its own internal “Edit file” tool. (the one which edits via small sub-LLM).  
100% hang repro rate on a 50KB large test file.

Output of my test script:  
python3 ./cursor\_acp\_edit\_file\_bug\_repro.py  
– seed source:  
– seed file (target): /tmp/acp\_edit\_repro\_saehflnd/repro\_seed.cpp  
– seed size: 51054 bytes, 1039 lines, 49 anchors  
– prompt mode: anchor  
– spawn: cursor-agent acp --model claude-opus-4-7-thinking-medium  
– sessionId: 0c065d88-5b0c-4b30-ab58-dc1807f5f160  
– starting loop: iterations=100 per\_call\_timeout=60.0s

[iter 001/100] start  
[19:21:39.697 think] I need  
[19:21:39.868 tool] 01EVZsLe4qKj read status=pending title=‘Read File’  
[19:21:39.900 tool\*] 01EVZsLe4qKj read status=in\_progress title=‘Read File’  
[19:21:39.923 tool\*] 01EVZsLe4qKj read status=completed title=‘Read File’  
[19:21:44.167 tool] 01DQ3ZWR4XkC edit status=pending title=‘Edit File’  
[19:21:46.070 tool\*] 01DQ3ZWR4XkC edit status=in\_progress title=‘Edit File’  
[iter 001/100] status=hang elapsed=60.04s tool\_events=5

* * *

## !! repro stopped at iteration 1/100

!! status: hang  
!! elapsed: 60.04s  
!! per\_call\_timeout was: 60.0s  
!! unfinished tool calls at hang:  
!! id=toolu\_01DQ3ZWR4XkCCo4QmrtKq6sx kind=edit title=‘Edit File’ status=in\_progress  
!! all tool calls this turn:  
!! toolu\_01EVZsLe4qKjtkFS78 kind=read title=‘Read File’ status=completed; toolu\_01DQ3ZWR4XkCCo4Qmr kind=edit title=‘Edit File’ status=in\_progress  
!! per-iteration elapsed (s): min=60.04 mean=60.04 max=60.04  
!! successful iterations before stop: 0

### Steps to Reproduce

I cannot share repro files with this form. So just create your own:

Reproduction without our scripts  
Create a ~50 KB C++ file with // === ANCHOR NNN === comments every ~20 lines.  
Start one ACP session:  
cursor-agent acp --model claude-opus-4-7-thinking-medium  
Drive the ACP session over stdio: initialize → session/new (with authMethodId: “cursor\_login”) → session/prompt with this prompt (auto-allow every session/request\_permission):  
Use the Edit File tool to modify /abs/path/to/seed.cpp. Find the line // === ANCHOR 005 === and insert two lines immediately below it: a comment and a small inline int fn\_005(int x) { return x + 5; }. Do not use the Write tool. Do not ask for confirmation.

Loop this prompt in the same session, restoring the file from the pristine 50 KB copy each iteration. Cap each turn at 60 s; an unreturned turn = hang.

### Expected Behavior

agent does not hang indefinitely

### Operating System

Linux

### Version Information

$ cursor --version  
3.5.33  
aac81804b986d739acab348ed96b8bea6e83cc50  
x64

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

cursor-agent acp --model claude-opus-4-7-thinking-medium

### Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

---

<div class="post-metadata">

**Author:** ![Jurij\_Gera](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jurij_gera/32/103209_2.png) [@Jurij\_Gera](https://forum.cursor.com/u/Jurij_Gera)\
**Post date:** [May 23, 2026, 3:41am UTC](https://forum.cursor.com/t/acp-edit-file-hangs/161370/5 "2026-05-23T03:41:32Z")

</div>

Update:  
seems size dependent.

Edit tool on 30KB file works, takes about 4 sec.  
On 35KB file hangs indefinitely.

Here is the theory:  
Edits are done through backend editor model which has input context limit. That model response carry a stop\_reason. The healthy one is “end\_turn”; when the model hits its output-token cap it returns “max\_tokens” instead. If cursor-agent’s apply-edit code only treats “end\_turn” as completion (and silently waits for more streaming tokens otherwise), which never come - tool call hangs.

Cursor IDE might be using different fast path, with in-house model for that. This is may be why the same issue did not surface in IDE up until now.

---

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [May 25, 2026, 11:17am UTC](https://forum.cursor.com/t/acp-edit-file-hangs/161370/7 "2026-05-25T11:17:27Z")

</div>

Thanks for the thorough report. The repro steps and size-dependency observation (30KB works, 35KB hangs) are very helpful.

I attempted to reproduce this on cursor-agent (macOS) using a generated ~50KB C++ file with anchor comments, but the Edit File tool completed successfully on both 30KB and 50KB files. This could be due to version, OS (I tested on macOS vs your Linux), or content differences.

A couple of questions to help us track this down:

1. Could you share your `cursor_acp_edit_file_bug_repro.py` script (or the key parts)? I’d like to run the exact same reproduction.

2. What cursor-agent version are you running? (Run `cursor-agent --version` to check – this is separate from the Cursor IDE version.)

3. Does the issue persist on the latest cursor-agent version? You can update by running `cursor-agent update`.

The more precisely we can match your environment, the faster we can isolate the root cause.

---

<div class="post-metadata">

**Author:** ![Jurij\_Gera](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jurij_gera/32/103209_2.png) [@Jurij\_Gera](https://forum.cursor.com/u/Jurij_Gera)\
**Post date:** [May 26, 2026, 5:36pm UTC](https://forum.cursor.com/t/acp-edit-file-hangs/161370/8 "2026-05-26T17:36:58Z")

</div>

Hi, thanks for looking into it.

[cursor\_acp\_edit\_file\_bug\_repro.zip](https://forum.cursor.com/uploads/short-url/nxuBs9fkNxkU3yPvi4YHEHJjh8q.zip) (9.7 KB)

Here is the script I used to reproduce.

`cursor-agent update`  
`says I already have the latest version`

$ cursor-agent --version  
2026.05.24-dda726e

And I am using it on Linux.

It gets stuck almost instantly in the first test iteration and times out after 240 seconds.

$ ./cursor\_acp\_edit\_file\_bug\_repro.py  
– seed source:  
– seed file (target): /tmp/acp\_edit\_repro\_0l3usky1/repro\_seed.cpp  
– seed size: 35688 bytes, 729 lines, 35 anchors  
– prompt mode: anchor  
– spawn: cursor-agent acp --model gpt-5.5-extra-high  
– sessionId: ae8c81ce-750e-42b1-a99b-3e55667851c2  
– starting loop: iterations=100 per\_call\_timeout=240.0s

[iter 001/100] start  
[10:35:50.675 tool] call\_glBG1S8 read status=pending title=‘Read File’  
[10:35:50.924 tool\*] call\_glBG1S8 read status=in\_progress title=‘Read File’  
[10:35:50.955 tool\*] call\_glBG1S8 read status=completed title=‘Read File’  
[10:35:51.949 tool] call\_GX8QOYF edit status=pending title=‘Edit File’  
[10:35:53.113 tool\*] call\_GX8QOYF edit status=in\_progress title=‘Edit File’  
 ← stuck ehre

The issue is only with ACP version. I asked Cursor to create CLI variant of the test and the CLI version worked, so the problem must be somehow specific to ACP.

---

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [May 27, 2026, 10:02am UTC](https://forum.cursor.com/t/acp-edit-file-hangs/161370/10 "2026-05-27T10:02:37Z")

</div>

Thanks for sharing the script and confirming the version. The ACP vs CLI finding is a key detail - it rules out the edit algorithm itself and points to something specific in the ACP tool execution path.

We have everything we need. I’ve filed this with our CLI team with the reproduction script attached. No further info needed from you - we’ll update this thread when there’s progress.
