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
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.
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:
-
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.
-
What cursor-agent version are you running? (Run cursor-agent --version to check – this is separate from the Cursor IDE version.)
-
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.
Hi, thanks for looking into it.
cursor_acp_edit_file_bug_repro.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.
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.