Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor bug report — setCardContentReady / Invalid array length → renderer crash (code 5)
Title
RangeError: Invalid array length in setCardContentReady crashes renderer (code 5) during agent-loop
Environment
| Field | Value |
|---|---|
| Cursor version | 3.6.31 |
| VS Code engine | 1.105.1 |
| Commit | 81fcf2931d7687b4ff3f3017858d0c6dee7e2a68 |
| Build date | 2026-05-31 |
| OS | macOS 26.5 (Build 25F71) |
| Hardware | Mac, 16 GB RAM |
| Mode | Agent loop (agent-loop wakelock active) |
| Workspace | Multi-root (3 folders); not iCloud-exclusive |
Summary
During Agent-mode conversations, the renderer crashes with renderer process gone (reason: crashed, code: 5). This is not an OOM kill: system RAM is ~60% free and the largest renderer process is typically 0.5–1.3 GB at crash time. main.log reports reason: crashed, not reason: oom.
Every crash is preceded within ~200–350 ms by the same JavaScript error in the Composer UI:
RangeError: Invalid array length
at fzx.setCardContentReady (workbench.desktop.main.js:55273:74924)
The failure occurs while re-rendering cumulative Composer card content after a multi-turn agent session — after file writes complete successfully. Ten occurrences on 2026-06-01, identical stack trace every time.
Steps to reproduce
- Open Cursor Agent (single chat,
activeCount=1). - Turn 1: Run a heavy agent turn — e.g. parallel shell greps across log directories, read multiple files, produce a formatted response with tables/timelines in chat.
- Turn 2: Ask the agent to write or update a markdown handoff/document file on disk.
- Agent completes tool calls; the file saves successfully.
- Within ~10–30 seconds, while the Composer card re-renders the cumulative transcript, the window crashes.
Observed on 2026-06-01 (representative):
- Crash #8 (session
20260601T130717, 13:11:41): handoff saved 13:11:31, crash 10 s later. - Crash #9 (session
20260601T131211, 13:16:11): handoff update in progress, crash during card render (~31 s into turn 2). - Crash #10 (session
20260601T131623, 13:19:44): handoff saved 13:19:33, crash 11 s later.
Expected behavior
Agent turn completes; Composer card renders; no renderer crash.
Actual behavior
Invalid array lengthlogged inwindow*/renderer.log.- ~300 ms later:
CodeWindow: renderer process gone (reason: crashed, code: 5)inmain.log. - Window shows “terminated unexpectedly (reason: ‘crashed’, code: ‘5’)”.
- Work on disk is preserved; crash is UI render failure, not file I/O.
Why this is not the usual code-5 / OOM issue
| Typical code-5 reports | This bug |
|---|---|
Renderer 3–4 GB+, reason: oom |
Renderer 0.5–1.3 GB, reason: crashed |
| Long session memory creep | Crashes on specific turn pattern (heavy turn 1 + doc write turn 2) |
Fixed by new chat / --disable-gpu |
Reproduced with HW accel on and off; fresh sessions still crash on same pattern |
| SQLite / analytics errors | Consistent setCardContentReady stack; no SQLITE_ERROR in these sessions |
Mitigations already tried (did not fix)
cursor.inlineDiff.enablePerformanceProtection: truediffEditor.maxComputationTime: 5000files.watcherExclude+search.exclude(broad patterns)- Workspace trimmed from 5 roots to 3
window.restoreWindows: "one",workbench.editor.limit: 8"disable-hardware-acceleration": trueandfalsein~/.cursor/argv.json(tested both; crashes on both)- Single agent chat (
activeCount=1) — not parallel agents - No
docs-builder buildor long background processes inside Cursor during repro
Log evidence (crash #10, session 20260601T131623)
window2_wb1/renderer.log (13:19:44.136):
[error] Invalid array length: RangeError: Invalid array length
at j0 (workbench.desktop.main.js:36623:28474)
at lM (workbench.desktop.main.js:36623:28657)
at fPe (workbench.desktop.main.js:36623:56784)
at HBr.value (workbench.desktop.main.js:36623:56650)
at ot._deliver (workbench.desktop.main.js:55:2962)
at ot._deliverQueue (workbench.desktop.main.js:55:3053)
at ot.fire (workbench.desktop.main.js:55:3390)
at fzx._emitDidChange (workbench.desktop.main.js:55273:78120)
at fzx.setCardContentReady (workbench.desktop.main.js:55273:74924)
at workbench.desktop.main.js:55370:67674 Invalid array length
main.log (13:19:44.427, ~291 ms later):
[error] CodeWindow: renderer process gone (reason: crashed, code: 5)
Wakelock context (same session, turn 2):
[info] [PowerMainService] Started wakelock id=1 owner=window:2 reason="agent-loop" activeCount=1
Crash count (2026-06-01)
Eight crashes with this signature in retained log sessions:
| Time | Session | Notes |
|---|---|---|
| 11:39 | 20260601T112304 |
After diff guardrail enabled |
| 12:12 | 20260601T112304 |
|
| 12:27 | 20260601T112304 |
|
| 12:29 | 20260601T122737 |
|
| 12:31 | 20260601T122943 |
|
| 13:11 | 20260601T130717 |
Handoff write; file saved before crash |
| 13:16 | 20260601T131211 |
Handoff update for crash #9 |
| 13:19 | 20260601T131623 |
Handoff saved 11 s before crash |
Two earlier sessions (20260601T111533, 20260601T111733) also crashed with code 5; log dirs may have rotated.
Not observed: Cursor Helper (Renderer) .ips in DiagnosticReports; jetsam/memory-pressure kills.
Secondary noise (probably unrelated)
Repeated OTLP exporter errors in renderer log immediately before some crashes:
OTLPExporterError: Bad Request — "Trace spans collection is not enabled for this user"
These appear on non-crashing turns too. Including for completeness; primary failure is setCardContentReady.
Suggested fix area
Composer card content assembly in setCardContentReady — likely allocating or indexing an array with an invalid length when cumulative agent transcript + tool output exceeds an internal threshold. Consider bounds checking, chunking, or virtualizing large card content instead of throwing an uncaught RangeError that kills the renderer.
Workaround (until fixed)
- Keep agent chat responses short; put tables/timelines in files on disk, not in chat.
- Start a fresh chat after heavy investigation turns instead of continuing the same Composer thread.
- Avoid multi-turn patterns: heavy parallel tool output (turn 1) → document write (turn 2) in the same chat.
Steps to Reproduce
- Open Cursor Agent (single chat,
activeCount=1). - Turn 1: Run a heavy agent turn — e.g. parallel shell greps across log directories, read multiple files, produce a formatted response with tables/timelines in chat.
- Turn 2: Ask the agent to write or update a markdown handoff/document file on disk.
- Agent completes tool calls; the file saves successfully.
- Within ~10–30 seconds, while the Composer card re-renders the cumulative transcript, the window crashes.
Expected Behavior
No back-to-back crashes.
Screenshots / Screen Recordings
cursor-bug-report-forum-attachment.txt (2.45 KB)
Operating System
MacOS
Version Information
Version: 3.6.31
VS Code Extension API: 1.105.1
Commit: 81fcf2931d7687b4ff3f3017858d0c6dee7e2a60
Date: 2026-05-31T17:46:29.630Z
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
xterm.js: 6.1.0-beta.220
OS: Darwin arm64 25.5.0
For AI issues: which model did you use?
Opus 4.8 then after numerous crashes, Auto
Does this stop you from using Cursor
No - Cursor works, but with this issue