Agent response corrupted: unrelated React/Next.js code appended mid-reply

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

During an agent chat in a WordPress project, the assistant began a correct structured reply for a plan todo, then abruptly switched mid-sentence into unrelated TypeScript/React code.

The injected content is a complete Next.js password-reset UI (ResetPasswordForm, useSearchParams, /api/auth/reset-password, Eye/EyeOff icons, etc.). This project has no such files (and the code does not belong to any other of my projects).

The corruption point is visible in the message: an Italian bullet about the todo ends with e); and immediately continues with const [isLoading, setIsLoading] = useState(false); — clearly two unrelated outputs merged.

Steps to Reproduce

Could not reproduce on other attempts of the same todo.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Version: 3.9.16 (user setup)
VS Code Extension API: 1.105.1
Commit: 042b3c1a4c53f2c3808067f519fbfc67b72cad80
Date: 2026-06-27T06:41:01.941Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Auto

For AI issues: add Request ID with privacy disabled

0f4b1238-804c-4b69-ac14-e9c45fd64b9d

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report with the Request ID and the video. That really helped us figure it out.

Good news about the main concern: this is not a data leak and not another user’s session. We checked your Request ID on our side, and the output was generated entirely within your own request. Nothing from other projects or accounts was included.

What actually happened is the model cut off the response halfway and then fell back into a very common training-data template. Password reset and auth forms are some of the most common patterns, so you got complete but totally unrelated Next.js code. It looks scary, but it’s just model confabulation, not mixed-in data.

We’ve seen this glitch before and we’re already tracking the issue. We don’t have an exact ETA for a fix yet.

Workaround for now: if the answer goes off the rails, don’t continue the same thread. Start a new chat. Continuing a broken session tends to drag bad context forward. Let us know if you can reproduce it reliably, but in our experience it’s a rare one-off.