Lost Agent Chat Sessions when re-running prompts

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Chat sessions lose their name field and have their unifiedMode changed from agent to chat when using “Run last prompt again” or interacting with the revert/continue popup. This causes sessions to become invisible in the UI while their data remains in the SQLite database.

Environment

  • Cursor Version: 2.1.49 (prerelease track)
  • OS: macOS 14.x (Sonoma)
  • Workspace: Multi-file TypeScript/Next.js project

Steps to Reproduce

  1. Create an agent chat session with significant work (1000+ lines of changes)
  2. Run a prompt that makes changes
  3. Use “Run last prompt again” (with same or different model)
  4. When the popup appears with “Continue and Revert” or “Continue” options, select either
  5. Session disappears from the chat list

Expected Behavior

Session should remain visible with its original name and all conversation history accessible.

Actual Behavior

  1. Session disappears from the chat sidebar
  2. In the SQLite database (~/Library/Application Support/Cursor/User/workspaceStorage/<hash>/state.vscdb):
    • The name field is removed entirely from the composer object
    • unifiedMode changes from "agent" to "chat"
  3. All conversation data and file changes remain in the database but are not displayed in UI

Evidence

Database Analysis

Affected sessions have this pattern:

// BEFORE (working session)
{
  "composerId": "e63d0173-dc67-48b4-8995-4d4bbf2a82a1",
  "name": "Phase 4 - Mentor Company Admin UI",
  "unifiedMode": "agent",
  "totalLinesAdded": 6597,
  "committedToBranch": "feature/mca-admin-complete"
}

// AFTER (broken session - note missing name, changed mode)
{
  "composerId": "f43c7537-a29e-4658-a161-13e35f9f064b",
  // "name" field is MISSING entirely
  "unifiedMode": "chat",  // was "agent"
  "totalLinesAdded": 1323,
  "committedToBranch": "feature/auth-lockout-gsm"
}

Sessions Affected in Our Case

Session Lines Branch Status
Phase 0 - Security +880 feature/security-foundation Name lost, mode=chat
Phase 1 - License Schema +843 feature/license-seat-schema Name lost, mode=chat
Phase 2 - Auth Lockout +1,323 feature/auth-lockout-gsm Name lost, mode=chat
Phase 3 - Super Admin UI +6,048 feature/sa-admin-complete Name lost, mode=chat

Workaround

We created a recovery script that directly modifies the SQLite database:

import sqlite3, json, os

db = os.path.expanduser("~/Library/Application Support/Cursor/User/workspaceStorage/<WORKSPACE_HASH>/state.vscdb")
conn = sqlite3.connect(db)
c = conn.cursor()

c.execute("SELECT value FROM ItemTable WHERE key = 'composer.composerData'")
data = json.loads(c.fetchone()[0])

for comp in data['allComposers']:
    if comp.get('composerId') == '<COMPOSER_ID>':
        comp['name'] = 'Session Name'
        comp['unifiedMode'] = 'agent'
        break

c.execute('UPDATE ItemTable SET value = ? WHERE key = "composer.composerData"', (json.dumps(data),))
conn.commit()

Important: Cursor must be completely closed before running this, or it will overwrite the fix on restart.

Impact

  • Severity: High - significant work becomes inaccessible
  • Data Loss: No actual data loss - conversation and changes exist in DB
  • Recovery: Possible via direct DB modification, but not user-friendly

Suggested Fix

  1. Preserve the name field during prompt retry/revert operations
  2. Don’t change unifiedMode unless explicitly requested
  3. If session state must change, keep it visible in UI (perhaps in “Archived” section)

Related Issues


Submitted by: Ali Argün
Date: December 6, 2025

Steps to Reproduce

  1. Create an agent chat session with significant work (1000+ lines of changes)
  2. Run a prompt that makes changes
  3. Use “Run last prompt again” (with same or different model)
  4. When the popup appears with “Continue and Revert” or “Continue” options, select either
  5. Session disappears from the chat list but data remains in SQLite database

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.49
VSCode Version: (check Help > About in Cursor)
Commit: (check Help > About in Cursor)

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report with the database analysis and recovery script - that’s super helpful.

I’ll pass this to the engineering team. The issue with losing the name field and unifiedMode changing when using “Run last prompt again” is clearly documented in your report.

A couple of questions to investigate further:

  1. Could you share any Console errors at the moment the session disappears? (Help > Toggle Developer Tools > Console tab)
  2. Does this reproduce consistently every time you use “Run last prompt again”?

For the future: I recommend regularly exporting important chats (chat context menu > Export Chat) or using the SpecStory extension for automatic backups.

Please let me know if you find anything else.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.