Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
During a multi-day, multi-batch coding task in Agent mode, the agent repeatedly exhibited “single-step halting”: it would run one test, fail, print a status message, and stop — requiring me to send “continue” over and over to advance one step at a time.
Inspecting the session transcript revealed the real cause: the model intermittently emitted its tool calls as raw … XML text inside the message body, instead of as structured tool-call events. Cursor does not parse XML text, so the tool call was never executed, and the turn ended as “successful” with the tool call dangling.
Evidence from the transcript (all numbers reproduced, not estimated):
- 66 tool calls were emitted as raw XML text instead of executed (Read 31, Shell 21, Grep 11, StrReplace 2, other 1).
- 44 occurrences of a dangling tag leaked into the message body (reasoning text exposed instead of kept internal).
- 23,362 normally-executed tool_use events in the same session, vs only 66 swallowed — confirming this is intermittent, not a hard failure.
The agent itself diagnosed this during the session: it deliberately issued the simplest possible commands (echo “test”, echo “clean-test”, echo “second-test”, echo “final-test”, pwd) and all of them were ALSO swallowed as text and never executed. This rules out “command too complex” and confirms the tool-call mechanism itself was failing intermittently.
Steps to Reproduce
This bug is intermittent and probabilistic — I could not find a deterministic trigger. Here is what I observed and how to detect it:
- Run a long, multi-batch coding task in Agent mode (in my case: a multi-day task with many test runs, git diffs, and compilation logs).
- At some point, the agent stops after a single step — it runs one command, prints a status message, and halts, requiring repeated “continue” prompts.
- To confirm the cause: inspect the agent’s last message before it halted. If the message body contains raw … (or <tool_call>…</tool_call>) XML tags instead of a structured tool-use event, the tool call was swallowed.
A minimal self-test the agent itself performed (and which also got swallowed): issuing the simplest possible commands like echo “test”, echo “clean-test”, echo “final-test”, pwd — all of these were emitted as text and never executed.
Workaround that reliably recovered the session: switch to Plan mode (tool calls execute normally there), or start a fresh chat.
Expected Behavior
When the model emits a tool call, Cursor should execute it as a structured tool-use event. If the tool call is malformed or emitted as raw XML text, Cursor should either (1) parse and execute it best-effort, or (2) detect it and surface an error / retry the turn — rather than silently ending the turn as “successful” with the tool call dangling. The silent “successful turn with a dangling tool call” is the core failure mode: it makes the agent appear done when it actually never ran its tool.
Operating System
MacOS
Version Information
Version: 3.25.6
VS Code Extension API: 1.128.0
Commit: f0df777c412b670d09e3eaf214967d779e67c080
Date: 2026-10-14T22:46:28.448Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0
For AI issues: which model did you use?
DeepSeek v4 pro
Additional Information
What we ruled out:
- Not a context-overload problem. A comparison session with the same model over the same period accumulated ~9.67M characters and did NOT degrade, while the degraded session accumulated ~10.56M characters. Nearly identical size, so raw context size is not the root cause.
- Not a decision-logic problem. The agent was not “choosing” to stop — it was attempting to issue tool calls, but they were being swallowed.
Workarounds that worked:
- Switch to Plan mode — tool calls execute reliably there.
- Start a fresh chat and restate the task.
- Switch models.
Suggested fix direction:
When the model emits / <tool_call> XML in the message body, Cursor should either parse-and-execute it (best-effort recovery), or detect it and surface a clear error / retry the turn, rather than silently ending the turn as “successful” with the tool call dangling.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor